Initialize coll when using Collection methods inside PersistentCollection
This commit is contained in:
parent
5fd844d73e
commit
6bae2eac29
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user