I am using Doctrine2 (Symfony2)
, in my controller I used one repository for one table (MySQL) and it does work. I want to add one repository more and find a record where one field is equal to a field from first (previous) table.
Something like:
SELECT * FROM table2 where 'table2.columnX' = 'table1.columnX';
$em = $this->getDoctrine()->getManager();
$employee = $em->getRepository('SomethingBundle:Employee')->find($id); [table1 -- it works!]
how here:
$repository2 = $this->getDoctrine()
->getRepository('NenadStoreBundle:Requirements');
$requirements = $repository2->findById *----where columnX = employeecolumnx