Completed
Push — master ( 663845...79fb76 )
by Igor
18s queued 13s
created

createLagersystemListQueryBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\SyliusLagersystemPlugin\Repository;
6
7
use Doctrine\ORM\QueryBuilder;
8
9
trait ProductVariantRepositoryTrait
10
{
11
    /**
12
     * @param string $alias
13
     * @param string $indexBy The index for the from.
14
     *
15
     * @return QueryBuilder
16
     */
17
    abstract public function createQueryBuilder($alias, $indexBy = null);
18
19
    public function createLagersystemListQueryBuilder(string $locale): QueryBuilder
20
    {
21
        return $this->createQueryBuilder('o')
22
            ->leftJoin('o.translations', 'translation', 'WITH', 'translation.locale = :locale')
23
            ->setParameter('locale', $locale)
24
            ;
25
    }
26
}
27