From 5635fa60a4bea0580b969a5cd9235e2ae6e18a78 Mon Sep 17 00:00:00 2001 From: Sander Marechal Date: Thu, 27 Jun 2013 14:17:41 +0200 Subject: [PATCH] Check owning entitiy on extra lazy get with OneToMany relation --- lib/Doctrine/ORM/Persisters/OneToManyPersister.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php b/lib/Doctrine/ORM/Persisters/OneToManyPersister.php index 120ad548d..2915fd2ed 100644 --- a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/OneToManyPersister.php @@ -47,7 +47,7 @@ class OneToManyPersister extends AbstractCollectionPersister throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); } - return $persister->load(array($mapping['indexBy'] => $index), null, null, array(), 0, 1); + return $persister->load(array($mapping['mappedBy'] => $coll->getOwner(), $mapping['indexBy'] => $index), null, null, array(), 0, 1); } /**