Horde_ActiveSync_Folder_Imap::unserialize PHP Method

unserialize() public method

Reconstruct the object from serialized data.
public unserialize ( string $data )
$data string The serialized data.
    public function unserialize($data)
    {
        $d_data = json_decode($data, true);
        if (!is_array($d_data) || empty($d_data['v']) || $d_data['v'] != self::VERSION) {
            // Try using the old serialization strategy, since this would save
            // an expensive resync of email collections.
            $d_data = @unserialize($data);
            if (!is_array($d_data) || empty($d_data['v']) || $d_data['v'] != 1) {
                throw new Horde_ActiveSync_Exception_StaleState('Cache version change');
            }
        }
        $this->_status = $d_data['s'];
        $this->_messages = $d_data['m'];
        $this->_serverid = $d_data['f'];
        $this->_class = $d_data['c'];
        $this->_lastSinceDate = $d_data['lsd'];
        $this->_softDelete = $d_data['sd'];
        $this->haveInitialSync = empty($d_data['hi']) ? !empty($this->_messages) : $d_data['hi'];
        if (!empty($this->_status[self::HIGHESTMODSEQ]) && is_string($this->_messages)) {
            $this->_messages = $this->_fromSequenceString($this->_messages);
        }
    }