mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Optimized RequestManagement
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\RightManagement\RightRequestManagement;
|
||||
namespace App\Domain\RequestManagement;
|
||||
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use App\Repository\Source\SourceRepository;
|
||||
use App\Domain\SourceManagement\RequestedSourceInterface;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
use App\Entity\Attribut\TypeAttribut;
|
||||
use App\Entity\Attribut\LayerAttribut;
|
||||
use App\Entity\Attribut\RecieverAttribut;
|
||||
use App\Exception\PreconditionFailedException;
|
||||
use App\Exception\NotSetException;
|
||||
use App\Repository\Source\SourceRepositoryInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -22,7 +20,7 @@ class RequestedRight implements RequestedRightInterface
|
||||
use TypeAttribut, LayerAttribut, RecieverAttribut;
|
||||
|
||||
/**
|
||||
* @var SourceRepository
|
||||
* @var SourceRepositoryInterface
|
||||
*/
|
||||
private $sourceRepository;
|
||||
|
||||
@@ -37,9 +35,9 @@ class RequestedRight implements RequestedRightInterface
|
||||
private $requestedSource;
|
||||
|
||||
/**
|
||||
* @param EntityManager $entityManager
|
||||
* @param SourceRepositoryInterface $sourceRepository
|
||||
*/
|
||||
public function __construct(SourceRepository $sourceRepository)
|
||||
public function __construct(SourceRepositoryInterface $sourceRepository)
|
||||
{
|
||||
$this->sourceRepository = $sourceRepository;
|
||||
}
|
||||
@@ -65,7 +63,7 @@ class RequestedRight implements RequestedRightInterface
|
||||
*
|
||||
* @see https://en.wikipedia.org/wiki/Lazy_loading
|
||||
* {@inheritdoc}
|
||||
* @see \App\Domain\RightManagement\RightRequestManagement\RequestedRightInterface::getSource()
|
||||
* @see \App\Domain\RequestManagement\RequestedRightInterface::getSource()
|
||||
*/
|
||||
final public function getSource(): SourceInterface
|
||||
{
|
||||
@@ -87,7 +85,7 @@ class RequestedRight implements RequestedRightInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \App\Domain\RightManagement\RightRequestManagement\RequestedRightInterface::setRequestedSource()
|
||||
* @see \App\Domain\RequestManagement\RequestedRightInterface::setRequestedSource()
|
||||
*/
|
||||
final public function setRequestedSource(RequestedSourceInterface $requestedSource)
|
||||
{
|
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\RightManagement\RightRequestManagement;
|
||||
namespace App\Domain\RequestManagement;
|
||||
|
||||
use App\Entity\Attribut\TypeAttributInterface;
|
||||
use App\Entity\Attribut\RecieverAttributInterface;
|
||||
use App\Entity\Attribut\LayerAttributInterface;
|
||||
use App\Domain\SourceManagement\RequestedSourceInterface;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
||||
/**
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\RightManagement\RightRequestManagement;
|
||||
namespace App\Domain\RequestManagement;
|
||||
|
||||
/**
|
||||
* Allows to use a right as a Service.
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\RightManagement\RightRequestManagement;
|
||||
namespace App\Domain\RequestManagement;
|
||||
|
||||
/**
|
||||
* Allows to use a right as a Service.
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\SourceManagement;
|
||||
namespace App\Domain\RequestManagement;
|
||||
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\SourceManagement;
|
||||
namespace App\Domain\RequestManagement;
|
||||
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\SourceManagement;
|
||||
namespace App\Domain\RequestManagement;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\RequestManagement;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RequestedSourceServiceInterface
|
||||
{
|
||||
}
|
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\RightManagement\RightRequestManagement;
|
||||
namespace App\Domain\RequestManagement;
|
||||
|
||||
use App\Entity\Source\SourceInterface;
|
||||
use App\Domain\SourceManagement\RequestedSourceInterface;
|
||||
use App\Domain\UserManagement\UserSourceDirectorInterface;
|
||||
use App\Exception\SetNotPossibleException;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -37,7 +37,7 @@ final class RequestedUserRightFacade implements RequestedUserRightFacadeInterfac
|
||||
*/
|
||||
public function setReciever(SourceInterface $reciever): void
|
||||
{
|
||||
$this->requestedRight->setReciever($reciever);
|
||||
throw new SetNotPossibleException('It\'s not possible to set the reciever!');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,7 +103,7 @@ final class RequestedUserRightFacade implements RequestedUserRightFacadeInterfac
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \App\Domain\RightManagement\RightRequestManagement\RequestedRightInterface::setRequestedSource()
|
||||
* @see \App\Domain\RequestManagement\RequestedRightInterface::setRequestedSource()
|
||||
*/
|
||||
public function setRequestedSource(RequestedSourceInterface $requestedSource)
|
||||
{
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\RightManagement\RightRequestManagement;
|
||||
namespace App\Domain\RequestManagement;
|
||||
|
||||
/**
|
||||
* Offers a Service for managing the rights.
|
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\SourceManagement;
|
||||
|
||||
interface RequestedSourceServiceInterface
|
||||
{
|
||||
}
|
@@ -3,10 +3,9 @@
|
||||
namespace App\Domain\UserManagement;
|
||||
|
||||
use App\Entity\UserInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use App\DBAL\Types\SystemSlugType;
|
||||
use App\Entity\User;
|
||||
use App\Repository\Source\SourceRepository;
|
||||
use App\Repository\Source\SourceRepositoryInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -19,7 +18,7 @@ final class UserSourceDirector implements UserSourceDirectorInterface
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @var SourceRepository
|
||||
* @var SourceRepositoryInterface
|
||||
*/
|
||||
private $sourceRepository;
|
||||
|
||||
@@ -38,10 +37,10 @@ final class UserSourceDirector implements UserSourceDirectorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EntityManagerInterface $entityManager
|
||||
* @param UserInterface $user
|
||||
* @param SourceRepositoryInterface $sourceRepository
|
||||
* @param UserInterface $user
|
||||
*/
|
||||
public function __construct(SourceRepository $sourceRepository, ?UserInterface $user)
|
||||
public function __construct(SourceRepositoryInterface $sourceRepository, ?UserInterface $user)
|
||||
{
|
||||
$this->sourceRepository = $sourceRepository;
|
||||
$this->setUser($user);
|
||||
|
Reference in New Issue
Block a user