1
0
mirror of synced 2025-01-18 22:41:43 +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
parent 5fd844d73e
commit 6bae2eac29

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();
} }