| Total Complexity | 7 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Coverage | 69.57% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | abstract class BasicObjectDataRepository extends ObjectDataRepository |
||
| 13 | { |
||
| 14 | /** @var ObjectManagerInterface */ |
||
| 15 | protected $objectManager; |
||
| 16 | |||
| 17 | /** @var string */ |
||
| 18 | protected $className; |
||
| 19 | |||
| 20 | 27 | public function __construct(ObjectManagerInterface $objectManager, string $className) |
|
| 21 | { |
||
| 22 | 27 | $this->objectManager = $objectManager; |
|
| 23 | 27 | $this->className = $className; |
|
| 24 | 27 | } |
|
| 25 | |||
| 26 | 20 | public function getClassName() : string |
|
| 27 | { |
||
| 28 | 20 | return $this->className; |
|
| 29 | } |
||
| 30 | |||
| 31 | public function setClassName(string $className) : void |
||
| 32 | { |
||
| 33 | $this->className = $className; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param mixed $id |
||
| 38 | * |
||
| 39 | * @return mixed[] |
||
| 40 | */ |
||
| 41 | 19 | public function find($id) : ?array |
|
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return mixed[] |
||
| 56 | */ |
||
| 57 | 19 | protected function getIdentifier() : array |
|
| 58 | { |
||
| 59 | 19 | return $this->objectManager |
|
| 60 | 19 | ->getClassMetadata($this->getClassName()) |
|
| 61 | 19 | ->getIdentifier(); |
|
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @param object $object |
||
| 66 | * |
||
| 67 | * @return mixed[] |
||
| 68 | */ |
||
| 69 | protected function getObjectIdentifier($object) : array |
||
| 74 | } |
||
| 75 | } |
||
| 76 |