QueryFactory::setPaginator()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
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