| Total Complexity | 3 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | abstract class UuidDomainObjectAbstract implements UuidDomainObjectInterface |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var string Read only objectId |
||
| 23 | */ |
||
| 24 | public $rId = ''; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var int Object uuid, same of db record |
||
| 28 | */ |
||
| 29 | protected $objectId = ''; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Get the UUID of the object (unique to the object type). |
||
| 33 | * |
||
| 34 | * <pre><code class="php">$object = new DomainObject($dependencies); |
||
| 35 | * |
||
| 36 | * $object->getId(); |
||
| 37 | * </code></pre> |
||
| 38 | * |
||
| 39 | * @return string Current object uuid. |
||
| 40 | */ |
||
| 41 | public function getId(): string |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Set the uuid for the object. |
||
| 48 | * |
||
| 49 | * <pre><code class="php">$object = new DomainObject($dependencies); |
||
| 50 | * |
||
| 51 | * $object->setId('10f6bace-22f3-4b42-9dda-659c89a3a3c9'); |
||
| 52 | * </code></pre> |
||
| 53 | * |
||
| 54 | * @param string $objectId New object uuid. |
||
| 55 | * |
||
| 56 | * @throws UnexpectedValueException If the uuid on the object is already set. |
||
| 57 | * |
||
| 58 | * @return string New object uid. |
||
| 59 | */ |
||
| 60 | public function setId(string $objectId): string |
||
| 72 |