OrmRepositoryTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createQueryBuilder() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Damax\Common\Doctrine\Orm;
6
7
use Doctrine\ORM\EntityManagerInterface;
8
use Doctrine\ORM\QueryBuilder;
9
10
/**
11
 * @codeCoverageIgnore
12
 */
13
trait OrmRepositoryTrait
14
{
15
    /**
16
     * @var EntityManagerInterface
17
     */
18
    private $em;
19
20
    /**
21
     * @var string
22
     */
23
    private $className;
24
25
    private function createQueryBuilder(string $alias): QueryBuilder
26
    {
27
        return $this->em
28
            ->createQueryBuilder()
29
            ->select($alias)
30
            ->from($this->className, $alias)
31
        ;
32
    }
33
}
34