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