20250113#1

This commit is contained in:
User
2025-01-13 04:23:59 +03:00
parent 448128d228
commit ac572cc92b
13 changed files with 409 additions and 23 deletions

View File

@@ -0,0 +1,14 @@
<?php
namespace Rmphp\Storage\Entity;
abstract class AbstractEntity implements EntityInterface {
/**
* @return int|null
*/
public function getId(): mixed {
return (isset($this->id)) ? (($this->id instanceof ValueObjectInterface) ? $this->id->get() : $this->id) : null;
}
}

View File

@@ -0,0 +1,18 @@
<?php
/**
* Created by PhpStorm.
* User: Zuev Yuri
* Date: 23.04.2024
* Time: 3:58
*/
namespace Rmphp\Storage\Entity;
interface EntityInterface {
/**
* @return int|null
*/
public function getId(): mixed;
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Rmphp\Storage\Entity;
interface ValueObjectInterface {
public function get();
public function __toString(): string;
}