Prepare for the new serialization mechanism

This commit is contained in:
fancyweb
2019-04-07 14:53:54 +02:00
parent 15cde09784
commit 72d7abe11c
+12 -2
View File
@@ -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));
}
}