mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Implementing Serializable
requires now __serialize
and __unserialize
This commit is contained in:
parent
c038e84fc2
commit
dd3ceaa637
@ -70,6 +70,16 @@ class Zend_Paginator_SerializableLimitIterator extends LimitIterator implements
|
||||
));
|
||||
}
|
||||
|
||||
public function __serialize(): array
|
||||
{
|
||||
return array(
|
||||
'it' => $this->getInnerIterator(),
|
||||
'offset' => $this->_offset,
|
||||
'count' => $this->_count,
|
||||
'pos' => $this->getPosition(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $data representation of the instance
|
||||
*/
|
||||
@ -80,6 +90,12 @@ class Zend_Paginator_SerializableLimitIterator extends LimitIterator implements
|
||||
$this->seek($dataArr['pos']+$dataArr['offset']);
|
||||
}
|
||||
|
||||
public function __unserialize(array $data): void
|
||||
{
|
||||
$this->__construct($data['it'], $data['offset'], $data['count']);
|
||||
$this->seek($data['pos']+$data['offset']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns value of the Iterator
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user