From 25f5b77a2605eef7b363cb6f666cacbbce89d40c Mon Sep 17 00:00:00 2001 From: Gilles Gauthier Date: Tue, 22 Jan 2019 08:06:13 +0100 Subject: [PATCH] Revert "Replaced use of ltrim as it doesn't work as intended. (#292)" (#301) This reverts commit 89e1b008e4aee352121f544c40a546cfd09986cd. --- Event/Subscriber/DoctrineORMSubscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Event/Subscriber/DoctrineORMSubscriber.php b/Event/Subscriber/DoctrineORMSubscriber.php index 62d8d24..b8cc6e8 100644 --- a/Event/Subscriber/DoctrineORMSubscriber.php +++ b/Event/Subscriber/DoctrineORMSubscriber.php @@ -78,7 +78,7 @@ public function filterEntity(GetFilterConditionEvent $event) if ($dqlFrom = $event->getQueryBuilder()->getDQLPart('from')) { $rootPart = reset($dqlFrom); - $fieldName = preg_replace('/^'.$rootPart->getAlias().'\./', '', $event->getField()); + $fieldName = ltrim($event->getField(), $rootPart->getAlias() . '.'); $metadata = $queryBuilder->getEntityManager()->getClassMetadata($rootPart->getFrom()); if (isset($metadata->associationMappings[$fieldName]) && (!$metadata->associationMappings[$fieldName]['isOwningSide'] || $metadata->associationMappings[$fieldName]['type'] === ClassMetadataInfo::MANY_TO_MANY)) {