The entity "Parent" stored in database database1 The entity "Child" stored in database database2
- "Parent" is related with "Child" by attribute "childs" as @OneToMany(targetEntity="Child")
- "Child" is related with "Parent" by attribute "parent" as @ManyToOne(targetEntity="Parent")
How to get a list of Parent childs?
For example:
$repo = $this->getDoctrine()->getRepository('AppBundle:Parent', 'database1');
$parent = $repo->find(1);
foreach ($parent.getChilds() as $child) {}
throws exception: Undefined table: 7 ERROR: relation "child" does not exist