| @@ 17-27 (lines=11) @@ | ||
| 14 | * @param $locale |
|
| 15 | * @return array |
|
| 16 | */ |
|
| 17 | public function findAllWithLocale($locale) |
|
| 18 | { |
|
| 19 | return $this |
|
| 20 | ->createQueryBuilder('n') |
|
| 21 | ->andWhere('n.published = true') |
|
| 22 | ->andWhere('n.locale = :locale') |
|
| 23 | ->setParameter('locale', $locale) |
|
| 24 | ->orderBy('n.position', 'ASC') |
|
| 25 | ->getQuery() |
|
| 26 | ->getResult(); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * @param $slug |
|
| @@ 49-60 (lines=12) @@ | ||
| 46 | * @param $locale |
|
| 47 | * @return \Alpixel\Bundle\CMSBundle\Entity\Node|null |
|
| 48 | */ |
|
| 49 | public function findOnePublishedBySlugAndLocale($slug, $locale) |
|
| 50 | { |
|
| 51 | return $this |
|
| 52 | ->createQueryBuilder('n') |
|
| 53 | ->andWhere('n.published = true') |
|
| 54 | ->andWhere('n.locale = :locale') |
|
| 55 | ->andWhere('n.slug = :slug') |
|
| 56 | ->setParameter('locale', $locale) |
|
| 57 | ->setParameter('slug', $slug) |
|
| 58 | ->getQuery() |
|
| 59 | ->getOneOrNullResult(); |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * @param $slug |
|
| @@ 67-77 (lines=11) @@ | ||
| 64 | * @param $locale |
|
| 65 | * @return \Alpixel\Bundle\CMSBundle\Entity\Node|null |
|
| 66 | */ |
|
| 67 | public function findOneBySlugAndLocale($slug, $locale) |
|
| 68 | { |
|
| 69 | return $this |
|
| 70 | ->createQueryBuilder('n') |
|
| 71 | ->andWhere('n.locale = :locale') |
|
| 72 | ->andWhere('n.slug = :slug') |
|
| 73 | ->setParameter('locale', $locale) |
|
| 74 | ->setParameter('slug', $slug) |
|
| 75 | ->getQuery() |
|
| 76 | ->getOneOrNullResult(); |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * @param \Alpixel\Bundle\CMSBundle\Entity\Node $node |
|