slovocast/app/src/Domain/Entity.php

25 lines
459 B
PHP

<?php
namespace Slovocast\Domain;
/**
* The Entity Trait is standard record based methods and properties that will
* turn any object in a domain into an Entity, by providing it with an ID
* property, setter and getter methods.
*/
trait Entity
{
protected mixed $id;
public function setId(mixed $id): static
{
$this->id = $id;
return $this;
}
public function getId(): mixed
{
return $this->id;
}
}