mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Implemented setIdentity for RequestedEntity
This commit is contained in:
@@ -3,10 +3,29 @@
|
||||
namespace App\Domain\RequestManagement\Entity;
|
||||
|
||||
use App\Entity\AbstractEntity;
|
||||
use App\Attribut\SlugAttribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class RequestedEntity extends AbstractEntity implements RequestedEntityInterface
|
||||
{
|
||||
use SlugAttribut;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \App\Domain\RequestManagement\Entity\RequestedEntityInterface::setIdentity()
|
||||
*/
|
||||
public function setIdentity($identity): void
|
||||
{
|
||||
if (is_numeric($identity)) {
|
||||
$this->setId($identity);
|
||||
$this->slug = null;
|
||||
|
||||
return;
|
||||
}
|
||||
$this->setSlug($identity);
|
||||
$this->id = null;
|
||||
}
|
||||
}
|
||||
|
@@ -3,10 +3,19 @@
|
||||
namespace App\Domain\RequestManagement\Entity;
|
||||
|
||||
use App\Entity\EntityInterface;
|
||||
use App\Attribut\SlugAttributInterface;
|
||||
|
||||
/**
|
||||
* A requested entity containes the stumb attributes to load an entity.
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RequestedEntityInterface extends EntityInterface
|
||||
interface RequestedEntityInterface extends EntityInterface, SlugAttributInterface
|
||||
{
|
||||
/**
|
||||
* Sets the slug or the id.
|
||||
*
|
||||
* @param string|int $identity
|
||||
*/
|
||||
public function setIdentity($identity): void;
|
||||
}
|
||||
|
@@ -5,6 +5,6 @@ namespace App\Domain\RequestManagement\Entity;
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RequestedEntityServiceInterface
|
||||
interface RequestedEntityServiceInterface extends RequestedEntityInterface
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user