Horde_Kolab_Storage_Driver::getStamp PHP Method

getStamp() public method

Returns a stamp for the current folder status. This stamp can be used to identify changes in the folder data.
public getStamp ( string $folder ) : Horde_Kolab_Storage_Folder_Stamp
$folder string Return the stamp for this folder.
return Horde_Kolab_Storage_Folder_Stamp A stamp indicating the current folder status.
    public function getStamp($folder);

Usage Example

Example #1
0
 /**
  * Report the status of this folder.
  *
  * @param Horde_Kolab_Storage_Folder_Stamp $previous  The previous stamp,
  *                                                    if available.
  *
  * @return Horde_Kolab_Storage_Folder_Stamp The stamp that can be used for
  *                                          detecting folder changes.
  */
 public function getStamp(Horde_Kolab_Storage_Folder_Stamp $previous = null)
 {
     if (empty($previous) || $previous->getToken() === false) {
         $this->_logger->debug('[KOLAB_STORAGE] Fetching stamp without token.');
         return $this->_driver->getStamp($this->_folder->getPath());
     }
     try {
         $this->_logger->debug('[KOLAB_STORAGE] Fetching stamp WITH token.');
         return $this->_driver->getStampFromToken($this->_folder->getPath(), $previous->getToken(), $previous->ids());
     } catch (Horde_Kolab_Storage_Exception $e) {
         // Possibly not supported with the current IMAP driver.
         $this->_logger->debug('[KOLAB_STORAGE] Attempted to fetch stamp with token, but backend did not support.');
         return $this->_driver->getStamp($this->_folder->getPath());
     }
 }
All Usage Examples Of Horde_Kolab_Storage_Driver::getStamp