From 9a47c7b6875b5a60f2cb0b4be37acacfe7b99dfb Mon Sep 17 00:00:00 2001 From: Aivaras Gotovskis Date: Mon, 20 Aug 2018 13:25:54 +0300 Subject: [PATCH] Prevent deep comparison of objects. --- src/AssociationHydrator.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/AssociationHydrator.php b/src/AssociationHydrator.php index bb4a5d0..9794dda 100644 --- a/src/AssociationHydrator.php +++ b/src/AssociationHydrator.php @@ -68,6 +68,8 @@ public function hydrateAssociation($subjects, string $associationPath): void $classMetadata = $this->entityManager->getClassMetadata($classMetadata->getAssociationTargetClass($initialAssociation)); } + $subjects = array_map([$this->entityManager->getUnitOfWork(), 'getEntityIdentifier'], $subjects); + $this->entityManager->createQueryBuilder() ->select('PARTIAL subject.{id}') ->addSelect('associations')