Skip to content

Commit

Permalink
Doctrine\ORM\Mapping\ClassMetadataInfo is now Doctrine\ORM\Mapping\Cl…
Browse files Browse the repository at this point in the history
…assMetadata (#22)
  • Loading branch information
spackmat authored Jul 31, 2024
1 parent 48b640f commit 4171901
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Event/Subscriber/DoctrineORMSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\QueryBuilder;
use Spiriit\Bundle\FormFilterBundle\Event\GetFilterConditionEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
Expand Down Expand Up @@ -91,7 +91,7 @@ public function filterEntity(GetFilterConditionEvent $event)
$fieldName = \str_replace(\sprintf('%s.', $rootPart->getAlias()), null, $event->getField());
$metadata = $queryBuilder->getEntityManager()->getClassMetadata($rootPart->getFrom());

if (isset($metadata->associationMappings[$fieldName]) && (!$metadata->associationMappings[$fieldName]['isOwningSide'] || $metadata->associationMappings[$fieldName]['type'] === ClassMetadataInfo::MANY_TO_MANY)) {
if (isset($metadata->associationMappings[$fieldName]) && (!$metadata->associationMappings[$fieldName]['isOwningSide'] || $metadata->associationMappings[$fieldName]['type'] === ClassMetadata::MANY_TO_MANY)) {
if (!$event->getFilterQuery()->hasJoinAlias($fieldName)) {
$queryBuilder->leftJoin($event->getField(), $fieldName);
}
Expand Down

0 comments on commit 4171901

Please sign in to comment.