| @@ 10-20 (lines=11) @@ | ||
| 7 | ||
| 8 | class NodeRepository extends EntityRepository |
|
| 9 | { |
|
| 10 | public function findAllWithLocale($locale) |
|
| 11 | { |
|
| 12 | return $this |
|
| 13 | ->createQueryBuilder('n') |
|
| 14 | ->andWhere('n.published = true') |
|
| 15 | ->andWhere('n.locale = :locale') |
|
| 16 | ->setParameter('locale', $locale) |
|
| 17 | ->orderBy('n.position', 'ASC') |
|
| 18 | ->getQuery() |
|
| 19 | ->getResult(); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function findOnePublishedBySlugAndLocale($slug, $locale) |
|
| 23 | { |
|
| @@ 22-33 (lines=12) @@ | ||
| 19 | ->getResult(); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function findOnePublishedBySlugAndLocale($slug, $locale) |
|
| 23 | { |
|
| 24 | return $this |
|
| 25 | ->createQueryBuilder('n') |
|
| 26 | ->andWhere('n.published = true') |
|
| 27 | ->andWhere('n.locale = :locale') |
|
| 28 | ->andWhere('n.slug = :slug') |
|
| 29 | ->setParameter('locale', $locale) |
|
| 30 | ->setParameter('slug', $slug) |
|
| 31 | ->getQuery() |
|
| 32 | ->getOneOrNullResult(); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function findTranslation(Node $node, $locale) |
|
| 36 | { |
|