I want obtain the relations with two tables.
This is my schema.yml
Oferta:
columns:
titol: { type: string(50), notnull: true }
sub_titol: { type: text }
data_inici: { type: date }
data_fi: { type: date }
Opcions:
columns:
oferta_id: { type: integer, notnull: true }
descripco: { type: string(150), notnull: true }
preu: { type: string(20), notnull: flase }
relations:
Oferta: {onDelete: CASCADE, local: oferta_id, foreign: id, foreignAlias: Opcions_FK}
The are this method: * @method Doctrine_Collection getOpcionsFK() Returns the current record's "Opcions_FK" collection
And i have this code:
foreach ($ofertes as $oferta) {
echo $oferta->getId();
$opcions = new Opcions();
$opcions = $oferta->getOpcionsFK(); //this line do a error Unknown record property / related component "opcions_fk" on "Oferta"
}
The error:
public function filterGet(Doctrine_Record $record, $name)
{
throw new Doctrine_Record_UnknownPropertyException(sprintf('Unknown record property / related component "%s" on "%s"', $name, get_class($record)));
}
}
Someone know what don't runs it?
Thanks
Regards