2019-01-13 17:02:15 +01:00
|
|
|
<?php
|
|
|
|
|
2019-01-20 12:54:56 +01:00
|
|
|
namespace App\Domain\RequestManagement\User;
|
2019-01-13 17:02:15 +01:00
|
|
|
|
|
|
|
use App\Entity\Source\SourceInterface;
|
|
|
|
use App\Domain\UserManagement\UserSourceDirectorInterface;
|
2019-01-15 22:57:54 +01:00
|
|
|
use App\Exception\SetNotPossibleException;
|
2019-01-20 12:54:56 +01:00
|
|
|
use App\Domain\RequestManagement\Right\RequestedRightInterface;
|
2019-01-20 12:54:39 +01:00
|
|
|
use App\Domain\RequestManagement\Right\AbstractRequestedRightFacade;
|
2019-01-13 17:02:15 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
2019-01-20 12:54:39 +01:00
|
|
|
class RequestedUser extends AbstractRequestedRightFacade implements RequestedUserInterface
|
2019-01-13 17:02:15 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var UserSourceDirectorInterface
|
|
|
|
*/
|
|
|
|
private $userSourceDirector;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param UserSourceDirectorInterface $userSourceDirector
|
|
|
|
*/
|
|
|
|
public function __construct(UserSourceDirectorInterface $userSourceDirector, RequestedRightInterface $requestedRight)
|
|
|
|
{
|
|
|
|
$this->userSourceDirector = $userSourceDirector;
|
2019-01-20 12:54:39 +01:00
|
|
|
parent::__construct($requestedRight);
|
2019-01-13 17:02:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-02-03 03:15:07 +01:00
|
|
|
* You MUST NO use this method! Use UserSourceDirector instead!
|
2019-01-13 17:02:15 +01:00
|
|
|
*
|
2019-02-03 03:15:07 +01:00
|
|
|
* @see UserSourceDirectorInterface
|
2019-02-12 17:40:38 +01:00
|
|
|
* @deprecated
|
2019-02-03 03:15:07 +01:00
|
|
|
* {@inheritdoc}
|
2019-01-20 10:41:58 +01:00
|
|
|
* @see \App\Attribut\RecieverAttributInterface::setReciever()
|
2019-01-13 17:02:15 +01:00
|
|
|
*/
|
|
|
|
public function setReciever(SourceInterface $reciever): void
|
|
|
|
{
|
2019-02-03 03:15:07 +01:00
|
|
|
throw new SetNotPossibleException('It\'s not possible to set the reciever! Set it via '.UserSourceDirectorInterface::class.'!');
|
2019-01-13 17:02:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*
|
2019-01-20 10:41:58 +01:00
|
|
|
* @see \App\Attribut\RecieverAttributInterface::getReciever()
|
2019-01-13 17:02:15 +01:00
|
|
|
*/
|
|
|
|
public function getReciever(): SourceInterface
|
|
|
|
{
|
|
|
|
return $this->userSourceDirector->getUser()->getSource();
|
|
|
|
}
|
|
|
|
}
|