Total Complexity | 4 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 72.72% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
8 | abstract class GenericHydrator implements MemorySavingHydrator |
||
9 | { |
||
10 | protected $entityManager; |
||
11 | protected $metaData; |
||
12 | protected $saveMemory = false; |
||
13 | |||
14 | 25 | public function __construct(EntityManager $entityManager) |
|
15 | { |
||
16 | 25 | $this->entityManager = $entityManager; |
|
17 | 25 | $this->metaData = $entityManager->getMetaData($this->getEntityClass()); |
|
18 | 25 | } |
|
19 | |||
20 | public function saveMemory(bool $save = true): void |
||
21 | { |
||
22 | $this->saveMemory = $save; |
||
23 | } |
||
24 | |||
25 | 12 | public function getEntityManager(): EntityManager |
|
28 | } |
||
29 | |||
30 | 1 | public function getMetaData(): EntityMetaData |
|
33 | } |
||
34 | |||
35 | abstract public static function getEntityClass(): string; |
||
36 | } |
||
37 |