【发布时间】:2011-11-04 21:04:13
【问题描述】:
我有这个 Symfony Recepciones 类,它与我的 BaseRecepciones 类声称的 Obras_Sociales_Recepciones 类相关:
/* @method Recepciones setRecepcionId() Sets the current record's "recepcion_id" value
* @method Recepciones setCuentaLaboratorioId() Sets the current record's "cuenta_laboratorio_id" value
* @method Recepciones setCuentasLaboratorios() Sets the current record's "Cuentas_Laboratorios" value
* @method Recepciones setObrasSocialesRecepciones() Sets the current record's "Obras_Sociales_Recepciones" collection
*/
abstract class BaseRecepciones extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('Recepciones');
$this->hasColumn('recepcion_id', 'integer', 4, array(
'type' => 'integer',
'fixed' => 0,
'unsigned' => true,
'primary' => true,
'autoincrement' => true,
'length' => 4,
));
$this->hasColumn('cuenta_laboratorio_id', 'integer', 4, array(
'type' => 'integer',
'fixed' => 0,
'unsigned' => true,
'primary' => false,
'notnull' => true,
'autoincrement' => false,
'length' => 4,
));
}
public function setUp()
{
parent::setUp();
$this->hasOne('Cuentas_Laboratorios', array(
'local' => 'cuenta_laboratorio_id',
'foreign' => 'cuenta_laboratorio_id'));
$this->hasMany('Obras_Sociales_Recepciones', array(
'local' => 'recepcion_id',
'foreign' => 'recepcion_id'));
}
}
但是......当我在一个动作上这样做时
$recepcionPrueba = new Recepciones();
$recepcionPrueba->setObrasSocialesRecepciones($myObject);
上面写着:
“Recepciones”上的未知记录属性/相关组件“obras_sociales_recepciones”
有什么想法吗?
【问题讨论】: