diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 41d360f02..b56d0930b 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -61,14 +61,14 @@ final class PersistentCollection implements Collection * * @var array */ - protected $association; + private $association; /** * The EntityManager that manages the persistence of the collection. * * @var Doctrine\ORM\EntityManager */ - protected $em; + private $em; /** * The name of the field on the target entities that points to the owner @@ -96,7 +96,7 @@ final class PersistentCollection implements Collection * * @var boolean */ - protected $initialized = true; + private $initialized = true; /** * The wrapped Collection instance. diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index 5f1a29859..caa8c22b3 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -779,11 +779,13 @@ class BasicEntityPersister while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) { $coll->hydrateAdd($this->_createEntity($result)); } + $stmt->closeCursor(); } else { $entities = array(); while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) { $entities[] = $this->_createEntity($result); } + $stmt->closeCursor(); return $entities; } } @@ -1220,11 +1222,13 @@ class BasicEntityPersister while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) { $coll->hydrateAdd($this->_createEntity($result)); } + $stmt->closeCursor(); } else { $entities = array(); while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) { $entities[] = $this->_createEntity($result); } + $stmt->closeCursor(); return $entities; } }