ClientRepositoryTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createClientQueryBuilder() 0 9 1
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