| 1 | <?php |
||
| 17 | class AbstractEntity extends stdClass |
||
| 18 | { |
||
| 19 | const UUID_TYPE_RANDOM = 4; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var UuidInterface |
||
| 23 | */ |
||
| 24 | protected $id; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @return string |
||
| 28 | */ |
||
| 29 | 9 | public function getId(): string |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @param string|null $id |
||
| 36 | * @throws InvalidUuidStringException |
||
| 37 | */ |
||
| 38 | 74 | public function setId(string $id = null) |
|
| 46 | |||
| 47 | /** |
||
| 48 | * @param string $id |
||
| 49 | * @return string |
||
| 50 | * @throws InvalidUuidStringException |
||
| 51 | */ |
||
| 52 | 61 | private function isValidString(string $id): string |
|
| 60 | |||
| 61 | /** |
||
| 62 | * @param UuidInterface $uuid |
||
| 63 | * @return UuidInterface |
||
| 64 | * @throws InvalidUuidStringException |
||
| 65 | */ |
||
| 66 | 60 | private function isVersionValid(UuidInterface $uuid): UuidInterface |
|
| 74 | } |
||
| 75 |