diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 947774542..462c23ec7 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -587,6 +587,8 @@ final class PersistentCollection implements Collection, Selectable */ public function add($value) { + $this->initialize(); + $this->coll->add($value); $this->changed(); @@ -757,6 +759,8 @@ final class PersistentCollection implements Collection, Selectable */ public function key() { + $this->initialize(); + return $this->coll->key(); } @@ -765,6 +769,8 @@ final class PersistentCollection implements Collection, Selectable */ public function current() { + $this->initialize(); + return $this->coll->current(); } @@ -773,6 +779,8 @@ final class PersistentCollection implements Collection, Selectable */ public function next() { + $this->initialize(); + return $this->coll->next(); }