If I use a query without queryBuilder with this dql
$query = $this->_em ->createQuery("SELECT p, g, c FROM LikeYeah\GoBundle\Entity\Product p JOIN p.garments g LEFT JOIN g.colours c ORDER BY p.id DESC ");
everything is fine, but if I use (what I believe is the same), a query through a query builder like this
$qb->select('p, g, c') ->from('LikeYeah\GoBundle\Entity\Product', 'p') ->join('p.garments', 'g') ->leftJoin('g.colours', 'c') ->orderBy('p.id', 'desc');
I get the following error:
"Semantic error" line 0, col 66 next to .colours c, LikeYeah \ GoBundle \ Entity \ Product ': Error: identification variable g used in the connection path expression, but has not been defined previously. "
What am I missing?
source share