Skip to content

Commit

Permalink
Initialize coll when using Collection methods inside PersistentCollec…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
austinsmorris committed Jul 22, 2013
1 parent 5fd844d commit 6bae2ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Doctrine/ORM/PersistentCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ public function set($key, $value)
*/
public function add($value)
{
$this->initialize();

$this->coll->add($value);

$this->changed();
Expand Down Expand Up @@ -757,6 +759,8 @@ public function offsetUnset($offset)
*/
public function key()
{
$this->initialize();

return $this->coll->key();
}

Expand All @@ -765,6 +769,8 @@ public function key()
*/
public function current()
{
$this->initialize();

return $this->coll->current();
}

Expand All @@ -773,6 +779,8 @@ public function current()
*/
public function next()
{
$this->initialize();

return $this->coll->next();
}

Expand Down

0 comments on commit 6bae2ea

Please sign in to comment.