| Total Complexity | 4 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 8 | class EntitySaverFactory |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var EntityManager |
||
| 12 | */ |
||
| 13 | protected $entityManager; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var EntitySaver |
||
| 17 | */ |
||
| 18 | protected $genericEntitySaver; |
||
| 19 | /** |
||
| 20 | * @var EntitySaver |
||
| 21 | */ |
||
| 22 | protected $genericSaver; |
||
| 23 | |||
| 24 | 3 | public function __construct(EntityManager $entityManager, EntitySaver $genericSaver) |
|
| 25 | { |
||
| 26 | 3 | $this->entityManager = $entityManager; |
|
| 27 | 3 | $this->genericSaver = $genericSaver; |
|
| 28 | 3 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * Gets the Entity Specific Saver if one is defined, otherwise the standard Entity Saver |
||
| 32 | * |
||
| 33 | * @param EntityInterface $entity |
||
| 34 | * |
||
| 35 | * @return EntitySaverInterface |
||
| 36 | */ |
||
| 37 | 2 | public function getSaverForEntity( |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Get the fully qualified name of the saver for the entity we are testing. |
||
| 50 | * |
||
| 51 | * @param EntityInterface $entity |
||
| 52 | * |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | 2 | protected function getSaverFqn( |
|
| 64 | } |
||
| 65 | } |
||
| 66 |