50 lines
1.3 KiB
PHP
Raw Normal View History

2019-01-13 17:02:15 +01:00
<?php
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;
use App\Domain\RequestManagement\Right\RequestedRightInterface;
use App\Domain\RequestManagement\Right\AbstractRequestedRightFacade;
2019-01-13 17:02:15 +01:00
/**
* @author kevinfrantz
*/
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;
parent::__construct($requestedRight);
2019-01-13 17:02:15 +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-01-15 22:57:54 +01:00
throw new SetNotPossibleException('It\'s not possible to set the reciever!');
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();
}
}