I am trying to get objects from one class connected to another class. Not all entities actually combined entities.
This is similar to the following statement:
SELECT a, b FROM A a LEFT JOIN B b ON a.id = b.aid GROUP BY a.id;
or in code:
$query_builder = $em->getRepository('repository_of_A')->createQueryBuilder('a'); $query_builder = $query_builder->leftJoin('a.b', b); $query_builder = $query_builder->groupBy('a.id'); $query = $query_builder->select('a, b')->getQuery(); $entities = $query->getResult();
Now the problem is that whenever there is no B object for A, Doctrine returns a proxy object for A. Since I work with reflections, I need a real object instead of a proxy.
In the attached screenshot, the object with index 26 does not have the corresponding object B for A (Shop).

Does anyone know why and how I can solve this problem?
Note. I know that I could just use the class name instead of the object when using reflections, but I would also like to understand the problem here, as this may affect the runtime ...
Edit: Attached screenshot
source share