Use DocQuery createQueryBuilder with tables that have no entity

0

Is it possible to query Doctrine's createQueryBuilder using a table that does not have an Entity?

Example: In the code below table table2 (t2) does not have an entity created, because it is a relationship table and only has the relation fields.

$this->createQueryBuilder('t1')
     ->select(['t1', 't2.id'])
     ->leftJoin('table2', 't2', 'ON', 't1.id = t2.id')
     ->andWhere('t2.id IS NOT NULL')
     ->getQuery()
     ->getResult();
    
asked by anonymous 12.09.2018 / 02:27

1 answer

0
  

Is it possible to query Doctrine's createQueryBuilder using a table that does not have an Entity?

Yes it is possible to use DBAL. link

    
02.10.2018 / 05:52