mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-07 07:57:01 +00:00
Prepare for the new serialization mechanism
This commit is contained in:
@@ -158,14 +158,24 @@ class Profile implements \IteratorAggregate, \Serializable
|
||||
return new \ArrayIterator($this->profiles);
|
||||
}
|
||||
|
||||
public function __serialize()
|
||||
{
|
||||
return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles];
|
||||
}
|
||||
|
||||
public function serialize()
|
||||
{
|
||||
return serialize([$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]);
|
||||
return serialize($this->__serialize());
|
||||
}
|
||||
|
||||
public function __unserialize(array $data)
|
||||
{
|
||||
list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data;
|
||||
}
|
||||
|
||||
public function unserialize($data)
|
||||
{
|
||||
list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = unserialize($data);
|
||||
$this->__unserialize(unserialize($data));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user