| Total Complexity | 6 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 9 | trait AbstractUuidFieldTrait |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var UuidInterface |
||
| 13 | */ |
||
| 14 | private $id; |
||
| 15 | |||
| 16 | use DebugEntityDataObjectIds; |
||
| 17 | |||
| 18 | abstract public static function buildUuid(UuidFactory $uuidFactory): UuidInterface; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * This is leveraging the setter injection that happens on Entity creation to ensure that the UUID is set |
||
| 22 | * |
||
| 23 | * @param UuidFactory $uuidFactory |
||
| 24 | */ |
||
| 25 | public function injectUuid(UuidFactory $uuidFactory) |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | public function getId(): UuidInterface |
||
| 33 | { |
||
| 34 | return $this->id; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function getUuid(): UuidInterface |
||
| 38 | { |
||
| 39 | return $this->id; |
||
| 40 | } |
||
| 41 | |||
| 42 | private function setId(UuidInterface $uuid): self |
||
| 51 | } |
||
| 52 | } |
||
| 53 |