ldc-boutique-cnc-sable/shared/DDD/EntityId.php
2026-10-27 09:58:12 +01:00

23 lines
451 B
PHP

<?php
declare(strict_types=1);
namespace Shared\DDD;
use Ramsey\Uuid\UuidInterface;
abstract readonly class EntityId implements \Stringable, Equatable
{
public readonly UuidInterface $value;
#[\Override]
public function __toString(): string
{
return $this->value->toString();
}
public function equals(mixed $other): bool
{
return $other instanceof self && $this->value->equals($other->value);
}
}