1
0
mirror of synced 2025-01-18 14:31:40 +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)
{
$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();
}