QueryFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A getPaginator() 0 3 1
A setPaginator() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace Rostenkowski\Doctrine\Query;
4
5
6
use Doctrine\ORM\EntityManager;
7
use Doctrine\ORM\Query;
8
use Nette\Utils\Paginator;
9
10
abstract class QueryFactory implements QueryFactoryInterface
11
{
12
13
	/**
14
	 * @var Paginator
15
	 */
16
	private $paginator;
17
18
19
	public function create(EntityManager $em): Query
20
	{
21
		return $this->configure($em);
22
	}
23
24
25
	public function getPaginator(): ?Paginator
26
	{
27
		return $this->paginator;
28
	}
29
30
31
	abstract protected function configure(EntityManager $em): Query;
32
33
34
	public function setPaginator(Paginator $paginator)
35
	{
36
		$this->paginator = $paginator;
37
38
		return $this;
39
	}
40
41
42
}
43