Hi,

I have three models: `Category`, `Product` (references `Category` and 
`Brand`) and `Brand`. `Category` is self referencing. I would like to fetch 
the name brands associated to each category in **hierarchical way** Any 
help?

This is my try, but it returns zero results:`

    $repository = $this->getDoctrine()->getRepository(
'ProjectBackendBundle:Subitem');
    $items = $repository->findAll();

    $qb1 = $repository->createQueryBuilder('s')
      ->select('i', 'c', 'b', 's')
      ->leftJoin('s.item', 'i')
      ->leftJoin('i.children', 'c')
      ->where('i.parent IS NULL')
      ->leftJoin('ProjectBackendBundle:Brand', 'b', 'WITH', 'b.id = s.brand'
)
      ->getQuery();


-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to