Implemented injection of RequestedEntityService to RequestedRightService

This commit is contained in:
Kevin Frantz
2019-02-13 16:26:32 +01:00
parent 6563a9fb5a
commit aafde4c0f9
9 changed files with 408 additions and 337 deletions

View File

@@ -11,6 +11,7 @@ use App\Domain\RequestManagement\Entity\RequestedEntityInterface;
use App\Attribut\RequestedEntityAttribut;
use App\Entity\Meta\MetaInterface;
use App\Exception\NotCorrectInstanceException;
use App\Domain\RequestManagement\Entity\RequestedEntity;
/**
* @author kevinfrantz
@@ -56,6 +57,16 @@ class RequestedRight implements RequestedRightInterface
throw new PreconditionFailedException(get_class($this->requestedEntity).' needs to have a defined attribut id or slug!');
}
/**
* @param RequestedEntity|null $requestedEntity
*/
public function __construct(?RequestedEntity $requestedEntity = null)
{
if ($requestedEntity) {
$this->setRequestedEntity($requestedEntity);
}
}
/**
* Uses some kind of Lazy loading.
*