| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| 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 | public function __construct(EntityManager $entityManager) |
||
| 21 | { |
||
| 22 | $this->entityManager = $entityManager; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Gets the Entity Specific Saver if one is defined, otherwise the standard Entity Saver |
||
| 27 | * |
||
| 28 | * @param EntityInterface $entity |
||
| 29 | * |
||
| 30 | * @return EntitySaverInterface |
||
| 31 | */ |
||
| 32 | public function getSaverForEntity( |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Get the fully qualified name of the saver for the entity we are testing. |
||
| 48 | * |
||
| 49 | * @param EntityInterface $entity |
||
| 50 | * |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | protected function getSaverFqn( |
||
| 62 | } |
||
| 63 | } |
||
| 64 |