@@ 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 |