【发布时间】:2014-02-09 14:43:49
【问题描述】:
我在表Empresa 中添加了一个新字段,所以我需要更改我的模型。为了不重新生成意味着模型表单过滤器的全部内容,我决定手动(手动)添加它,所以我尝试将属性添加到BaseSdrivingEmpresa.class.php,如下所示:
<?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 |内部服务器错误 | 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() ?>
我的错误在哪里?
【问题讨论】:
标签: php doctrine symfony1 symfony-1.4 doctrine-1.2