| 1 | <?php |
||
| 7 | class CategoryRepository extends EntityRepository |
||
| 8 | { |
||
| 9 | public function findOrderedByPosition() |
||
| 10 | { |
||
| 11 | return $this |
||
| 12 | ->createQueryBuilder('c') |
||
| 13 | ->select('c, m') |
||
| 14 | ->leftJoin('c.meals', 'm') |
||
| 15 | ->orderBy('c.position', 'ASC') |
||
| 16 | ->addOrderBy('m.position', 'ASC') |
||
| 17 | ->getQuery() |
||
| 18 | ->getResult() |
||
| 19 | ; |
||
| 20 | } |
||
| 21 | |||
| 22 | public function countAll() |
||
| 31 | } |
||
| 32 |