diff --git a/Event/Subscriber/DoctrineORMSubscriber.php b/Event/Subscriber/DoctrineORMSubscriber.php index 3db9776..cb42cca 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 = ltrim($event->getField(), $rootPart->getAlias() . '.'); + $fieldName = substr($event->getField(), strlen($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)) {