Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function findByEnabledQueryBuilder(ChannelInterface $channel, TaxonInterface $taxon = null): QueryBuilder |
||
18 | { |
||
19 | $queryBuilder = $this->createQueryBuilder('b') |
||
20 | ->innerJoin('b.channels', 'channel') |
||
21 | ->andWhere('b.enabled = :enabled') |
||
22 | ->andWhere('channel = :channel') |
||
23 | ->setParameter('channel', $channel) |
||
24 | ->setParameter('enabled', true) |
||
25 | ; |
||
26 | |||
27 | if ($taxon) { |
||
28 | $queryBuilder->innerJoin('b.taxons', 'taxon') |
||
29 | ->andWhere('taxon = :taxon') |
||
30 | ->setParameter('taxon', $taxon) |
||
31 | ; |
||
32 | } |
||
33 | |||
34 | return $queryBuilder; |
||
35 | } |
||
53 |