I have 3 MySQL tables with the following columns:
table1: uid, name
table2: uid, color
table3: uid, car
The values of the column uid are all the same. I would like to get the values from the columns name, color and car, where the uid is = 5.
Well, I could use:
$this->getDoctrine()->getRepository(Table1::class)->findOneBy(array('uid' => 5));
$this->getDoctrine()->getRepository(Table2::class)->findOneBy(array('uid' => 5));
$this->getDoctrine()->getRepository(Table3::class)->findOneBy(array('uid' => 5));
Since there will be multiple queries, this would be bad for performance. Is there a way I could get all the records with only 1 query?