| Conditions | 3 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function getPageBlocksBySlugQueryBuilder($slug, $filter = null, $sort = null) |
||
| 25 | { |
||
| 26 | $qb = $this->createQueryBuilder('page_blocks_by_slug'); |
||
| 27 | |||
| 28 | $qb->select(['pageGroup', 'pageBlocks']); |
||
| 29 | $qb->from('AppBundle:PageGroup', 'pageGroup') |
||
| 30 | ->leftJoin('pageGroup.pageBlocks', 'pageBlocks') |
||
| 31 | ->where('pageGroup.slug = :slug') |
||
| 32 | ->setParameter('slug', $slug); |
||
| 33 | |||
| 34 | if ($filter) { |
||
| 35 | $qb->andWhere($filter); |
||
| 36 | } |
||
| 37 | |||
| 38 | if ($sort) { |
||
| 39 | $qb->addOrderBy($sort); |
||
| 40 | } else { |
||
| 41 | $qb->addOrderBy('pageBlocks.position', 'ASC'); |
||
| 42 | } |
||
| 43 | |||
| 44 | return $qb; |
||
| 45 | } |
||
| 46 | |||
| 61 |