Don't like ads? PRO users don't see any ads ;-)
Guest

doctrine bug

By: a guest on Dec 29th, 2011  |  syntax: PHP  |  size: 0.25 KB  |  hits: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $qb = $em->createQueryBuilder()
  2.         ->select('t, c, p')
  3.         ->from('Task', 't')
  4.         ->leftJoin('t.children', 'c')
  5.         ->leftJoin('t.parent', 'p')
  6.         ->orderBy('t.root, t.lft')
  7. ;
  8.  
  9. foreach( $qb->getQuery()->getResult() as $task)
  10. {
  11.         $task->getChildren()->count();
  12. }