我在表Empresa
中添加了一个新字段,所以我需要更改我的模型。对于无法再生的整个事情意味着模型形式的过滤器我决定用手工(手动)进行添加,所以我试图将属性添加到BaseSdrivingEmpresa.class.php
如下:手动添加属性到Symfony1.4和Doctrine的基本模型
<?php
/**
* BaseSdrivingEmpresa
*
* This class has been auto-generated by the Doctrine ORM Framework
*
* @property integer $umbralvoz
*
* @method integer getUmbralvoz() Returns the current record's "umbralvoz" value
* @method SdrivingEmpresa setUmbralvoz() Sets the current record's "umbralvoz" value
*
* @package isecurdriving
* @subpackage model
* @author Your name here
* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
*/
abstract class BaseSdrivingEmpresa extends sfDoctrineRecord {
public function setTableDefinition() {
$this->setTableName('sdriving_empresa');
$this->hasColumn('umbralvoz', 'integer', 11, array(
'type' => 'integer',
'notnull' => false,
'default' => 60,
'length' => 11,
));
}
}
但我得到这个错误:
500 | Internal Server Error | Doctrine_Record_UnknownPropertyException
任何时候,我尝试获得的财产,以显示它的模板:
$id_empresa = $this->getUser()->getGuardUser()->getSfGuardUserProfile()->getIdempresa();
$this->sdriving_configuracion = Doctrine_Core::getTable('SdrivingEmpresa')->createQuery('a')->where('a.idempresa = ?', $id_empresa)->execute();
<?php echo $sdriving_configuracion[0]->SdrivingEmpresa->getUmbralvoz() ?>
哪里是我的错误?