From cf625f02a6f4a2b83c076715a179ffd8e2a3f0cc Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Wed, 31 Oct 2018 22:57:56 +0100 Subject: [PATCH] Optimized Facade --- application/src/Entity/Source/SourceInterface.php | 3 ++- .../Facade/Security/Source/AbstractSourceFacade.php | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/application/src/Entity/Source/SourceInterface.php b/application/src/Entity/Source/SourceInterface.php index d72ae56..bb49ca9 100644 --- a/application/src/Entity/Source/SourceInterface.php +++ b/application/src/Entity/Source/SourceInterface.php @@ -6,10 +6,11 @@ use App\Entity\Attribut\IdAttributInterface; use App\Entity\EntityInterface; use App\Entity\Source\Attribut\GroupSourcesAttributInterface; use App\Entity\Attribut\LawAttributInterface; +use App\Entity\Attribut\RelationAttributInterface; /** * @author kevinfrantz */ -interface SourceInterface extends IdAttributInterface, EntityInterface, GroupSourcesAttributInterface, LawAttributInterface +interface SourceInterface extends IdAttributInterface, EntityInterface, GroupSourcesAttributInterface, LawAttributInterface, RelationAttributInterface { } diff --git a/application/src/Structur/Facade/Security/Source/AbstractSourceFacade.php b/application/src/Structur/Facade/Security/Source/AbstractSourceFacade.php index 3f8345a..2b8ab96 100644 --- a/application/src/Structur/Facade/Security/Source/AbstractSourceFacade.php +++ b/application/src/Structur/Facade/Security/Source/AbstractSourceFacade.php @@ -2,11 +2,12 @@ namespace App\Structur\Facade\Security\Source; -use App\Entity\NodeInterface; use App\Entity\Source\SourceInterface; use App\Entity\User; use App\DBAL\Types\RightType; use App\DBAL\Types\LayerType; +use App\Entity\Meta\RelationInterface; +use App\Entity\Meta\Relation; /** * @author kevinfrantz @@ -40,7 +41,7 @@ abstract class AbstractSourceFacade implements SourceFacadeInterface throw \Exception("The id can't be changed!"); } - public function setNode(NodeInterface $node): void + public function setRelation(RelationInterface $relation): void { throw \Exception("The node can't be changed!"); } @@ -52,7 +53,7 @@ abstract class AbstractSourceFacade implements SourceFacadeInterface } } - public function getNode(): NodeInterface + public function getRelation(): Relation { if ($this->isGranted(RightType::READ, LayerType::NODE)) { return $source->getNode();