mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Declared setActionType as immutable for RequestedRight
This commit is contained in:
@@ -12,6 +12,7 @@ use Infinito\Entity\Meta\MetaInterface;
|
||||
use Infinito\Exception\NotCorrectInstanceException;
|
||||
use Infinito\Domain\RequestManagement\Entity\RequestedEntity;
|
||||
use Infinito\Attribut\ActionTypeAttribut;
|
||||
use Infinito\Exception\AllreadySetException;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -20,7 +21,9 @@ use Infinito\Attribut\ActionTypeAttribut;
|
||||
*/
|
||||
class RequestedRight implements RequestedRightInterface
|
||||
{
|
||||
use ActionTypeAttribut, LayerAttribut, RecieverAttribut, RequestedEntityAttribut;
|
||||
use LayerAttribut, RecieverAttribut, RequestedEntityAttribut, ActionTypeAttribut{
|
||||
setActionType as private setActionTypeTrait;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var SourceInterface
|
||||
@@ -67,6 +70,20 @@ class RequestedRight implements RequestedRightInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function declares the attribute actionType as inmutable
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \Infinito\Attribut\ActionTypeAttributInterface::setActionType()
|
||||
*/
|
||||
public function setActionType(string $actionType): void
|
||||
{
|
||||
if (isset($this->actionType)) {
|
||||
throw new AllreadySetException("The action type is allready set! Origine: $this->actionType New: $actionType");
|
||||
}
|
||||
$this->setActionTypeTrait($actionType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses some kind of Lazy loading.
|
||||
*
|
||||
|
Reference in New Issue
Block a user