From b4e0607a3fca4cb464d25406bdf92b8825a9ea39 Mon Sep 17 00:00:00 2001 From: Daniel Lienert Date: Fri, 1 Nov 2019 10:32:06 +0100 Subject: [PATCH] BUGFIX: Exchange Doctrine Objectmanager import --- .../Privilege/Node/Doctrine/ConditionGenerator.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Classes/Security/Authorization/Privilege/Node/Doctrine/ConditionGenerator.php b/Classes/Security/Authorization/Privilege/Node/Doctrine/ConditionGenerator.php index 6e601b9..84cb3b3 100644 --- a/Classes/Security/Authorization/Privilege/Node/Doctrine/ConditionGenerator.php +++ b/Classes/Security/Authorization/Privilege/Node/Doctrine/ConditionGenerator.php @@ -11,11 +11,12 @@ * source code. */ +use Doctrine\DBAL\DBALException; +use Doctrine\ORM\EntityManagerInterface; use Neos\Flow\Annotations as Flow; use Neos\Flow\Security\Authorization\Privilege\Entity\Doctrine\FalseConditionGenerator; use Neos\ContentRepository\Security\Authorization\Privilege\Node\Doctrine\ConditionGenerator as NeosContentRepositoryConditionGenerator; use Neos\Flow\Security\Authorization\Privilege\Entity\Doctrine\SqlGeneratorInterface; -use Doctrine\Common\Persistence\ObjectManager; /** @@ -25,7 +26,7 @@ class ConditionGenerator extends NeosContentRepositoryConditionGenerator { /** * @Flow\Inject - * @var ObjectManager + * @var EntityManagerInterface */ protected $entityManager; @@ -34,8 +35,9 @@ class ConditionGenerator extends NeosContentRepositoryConditionGenerator * @param mixed $value * * @return SqlGeneratorInterface + * @throws DBALException */ - public function nodePropertyIs($property, $value) + public function nodePropertyIs(string $property, $value): SqlGeneratorInterface { $propertyConditionGenerator = new PropertyConditionGenerator('properties'); @@ -43,7 +45,7 @@ public function nodePropertyIs($property, $value) return new FalseConditionGenerator(); } - if ($this->entityManager->getConnection()->getDatabasePlatform()->getName() === "postgresql"){ + if ($this->entityManager->getConnection()->getDatabasePlatform()->getName() === "postgresql") { return $propertyConditionGenerator->postgresJsonContains('{"' . trim($property) . '": ' . json_encode($value) . '}'); } @@ -55,8 +57,9 @@ public function nodePropertyIs($property, $value) * @param mixed $value * * @return SqlGeneratorInterface + * @throws DBALException */ - public function parentNodePropertyIs($property, $value) + public function parentNodePropertyIs(string $property, $value): SqlGeneratorInterface { $propertiesConditionGenerator = $this->nodePropertyIs($property, $value); $subQueryGenerator = new ParentNodePropertyGenerator($propertiesConditionGenerator);