hello ,
i get table - $data = Doctrin ::getTable('product_catalog')->findAll();. this table (product_catalog) i link table. have 2 couloms with foreign keys.
how i can check on $data have relation?
thanks
hello ,
i get table - $data = Doctrin ::getTable('product_catalog')->findAll();. this table (product_catalog) i link table. have 2 couloms with foreign keys.
how i can check on $data have relation?
thanks
Try $data->hasRelation('RelationName')
which will check for the existence of the related object on your foreign key. Replace RelationName
with the real name of your relation.
i secsess to get relation from table. see this code
$data = ORM::getTable($modelName)->findAll(); - get the table. $relations = $data->getTable()->getRelations(); - >get to relation foreach($relations as $key=>$row) { echo "
"; var_dump($key); echo "";
} die(); this is print on screen ths table relation.