Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Revert "Replaced use of ltrim as it doesn't work as intended. (#292)" (
Browse files Browse the repository at this point in the history
…#301)

This reverts commit 89e1b00.
  • Loading branch information
gilles-g authored Jan 22, 2019
1 parent 89e1b00 commit 25f5b77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Event/Subscriber/DoctrineORMSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 25f5b77

Please sign in to comment.