63 lines
1.8 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
}
/**
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();
}
2019-02-13 15:09:03 +01:00
/**
* {@inheritdoc}
*
* @see \App\Domain\RequestManagement\User\RequestedUserInterface::getUserSourceDirector()
*/
public function getUserSourceDirector(): UserSourceDirectorInterface
{
return $this->userSourceDirector;
}
2019-01-13 17:02:15 +01:00
}