1
0
mirror of synced 2025-02-02 13:31:45 +03:00

Initialize coll when using Collection methods inside PersistentCollection

This commit is contained in:
Austin Morris 2013-07-22 14:42:03 -04:00 committed by Benjamin Eberlei
parent 1dae8d318f
commit 39f4d46d36

View File

@ -587,6 +587,8 @@ final class PersistentCollection implements Collection, Selectable
*/ */
public function add($value) public function add($value)
{ {
$this->initialize();
$this->coll->add($value); $this->coll->add($value);
$this->changed(); $this->changed();
@ -757,6 +759,8 @@ final class PersistentCollection implements Collection, Selectable
*/ */
public function key() public function key()
{ {
$this->initialize();
return $this->coll->key(); return $this->coll->key();
} }
@ -765,6 +769,8 @@ final class PersistentCollection implements Collection, Selectable
*/ */
public function current() public function current()
{ {
$this->initialize();
return $this->coll->current(); return $this->coll->current();
} }
@ -773,6 +779,8 @@ final class PersistentCollection implements Collection, Selectable
*/ */
public function next() public function next()
{ {
$this->initialize();
return $this->coll->next(); return $this->coll->next();
} }