Horde_Kolab_Storage_Cache_Data::getStamp PHP Method

getStamp() public method

Retrieves the last stamp.
public getStamp ( ) : Horde_Kolab_Storage_Folder_Stamp
return Horde_Kolab_Storage_Folder_Stamp The last recorded stamp.
    public function getStamp()
    {
        $this->_checkInit(self::STAMP);
        return $this->_data[self::STAMP];
    }

Usage Example

Example #1
0
 /**
  * Synchronize the query data with the information from the backend.
  *
  * @param array $params Additional parameters.
  *
  * @return NULL
  */
 public function synchronize($params = array())
 {
     $current = $this->getStamp();
     if (!$this->_data_cache->isInitialized()) {
         $this->_completeSynchronization($current);
         return;
     }
     $previous = unserialize($this->_data_cache->getStamp());
     if ($previous === false || $previous->isReset($current)) {
         $this->_completeSynchronization($current);
         return;
     }
     if (!isset($params['changes'])) {
         $changes = $previous->getChanges($current);
         $params['changes'][Horde_Kolab_Storage_Folder_Stamp::ADDED] = $this->fetch($changes[Horde_Kolab_Storage_Folder_Stamp::ADDED]);
         $params['changes'][Horde_Kolab_Storage_Folder_Stamp::DELETED] = $this->_data_cache->backendMap($changes[Horde_Kolab_Storage_Folder_Stamp::DELETED]);
     }
     if ($params['changes'] !== false) {
         $params['last_sync'] = $this->_data_cache->getLastSync();
         $this->_data_cache->store($params['changes'][Horde_Kolab_Storage_Folder_Stamp::ADDED], $current, $this->getVersion(), $params['changes'][Horde_Kolab_Storage_Folder_Stamp::DELETED]);
         $params['current_sync'] = $this->_data_cache->getLastSync();
         parent::synchronize($params);
         $this->_data_cache->save();
     }
     $this->_init = true;
 }
All Usage Examples Of Horde_Kolab_Storage_Cache_Data::getStamp