ClientRepositoryTrait::createClientQueryBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 9
rs 10
1
<?php
2
3
/*
4
 * This file is part of the SaasProviderBundle package.
5
 * (c) Fluxter <http://fluxter.net/>
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Fluxter\SaasProviderBundle\Repository\Abstraction;
11
12
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
13
use Fluxter\SaasProviderBundle\Model\SaasClientInterface;
14
15
trait ClientRepositoryTrait
16
{
17
    public function createClientQueryBuilder(SaasClientInterface $client, string $alias, $indexedBy = null)
18
    {
19
        /** @var ServiceEntityRepository $this */
20
        $qb = $this->createQueryBuilder($alias, $indexedBy);
21
        $qb
22
            ->andWhere($alias . '.client = :client')
23
            ->setParameter('client', $client->getId());
24
25
        return $qb;
26
    }
27
}
28