notes_getActionTimestamp() публичный Метод

Return the timestamp for the last time $action was performed.
С версии: 5.1
public notes_getActionTimestamp ( string $uid, string $action, string $notepad = null ) : integer
$uid string The UID of the task we are interested in.
$action string The action we are interested in (add, modify...)
$notepad string The notepad to use, if not using multiplex.
Результат integer
Пример #1
0
 /**
  * Stat a backend item, optionally using the cached value if available.
  *
  * @param string  $folderid  The folder id
  * @param string  $id        The message id
  * @param boolean $hint      Use the cached data, if available?
  *
  * @return message stat hash
  */
 protected function _smartStatMessage($folderid, $id, $hint)
 {
     ob_start();
     $this->_logger->info(sprintf("[%s] Horde_Core_ActiveSync_Driver::_smartStatMessage(%s, %s)", $this->_pid, $folderid, $id));
     $statKey = $folderid . $id;
     $mod = false;
     if ($hint && isset($this->_modCache[$statKey])) {
         $mod = $this->_modCache[$statKey];
     } else {
         try {
             // @TODO Horde 6 - combine into single getActionTimestamp method
             // and pass the folderid.
             // First, see if we are using a multiplexed id.
             switch ($folderid) {
                 case self::APPOINTMENTS_FOLDER_UID:
                     $mod = $this->_connector->calendar_getActionTimestamp($id, 'modify');
                     break;
                 case self::CONTACTS_FOLDER_UID:
                     $mod = $this->_connector->contacts_getActionTimestamp($id, 'modify');
                     break;
                 case self::TASKS_FOLDER_UID:
                     $mod = $this->_connector->tasks_getActionTimestamp($id, 'modify');
                     break;
                 case self::NOTES_FOLDER_UID:
                     $mod = $this->_connector->notes_getActionTimestamp($id, 'modify');
                     break;
                 default:
                     // Not using non-email multiplexed collection.
                     $folder_parts = $this->_parseFolderId($folderid);
                     if (count($folder_parts) == 2) {
                         $folder_class = $folder_parts[self::FOLDER_PART_CLASS];
                         $serverid = $folder_parts[self::FOLDER_PART_ID];
                     } else {
                         $folder_class = false;
                         $serverid = null;
                     }
                     switch ($folder_class) {
                         case Horde_ActiveSync::CLASS_CALENDAR:
                             $mod = $this->_connector->calendar_getActionTimestamp($id, 'modify', $serverid);
                             break;
                         case Horde_ActiveSync::CLASS_CONTACTS:
                             $mod = $this->_connector->contacts_getActionTimestamp($id, 'modify', $serverid);
                             break;
                         case Horde_ActiveSync::CLASS_TASKS:
                             $mod = $this->_connector->tasks_getActionTimestamp($id, 'modify', $serverid);
                             break;
                         case Horde_ActiveSync::CLASS_NOTES:
                             $mod = $this->_connector->notes_getActionTimestamp($id, 'modify', $serverid);
                             break;
                         default:
                             try {
                                 return $this->statMailMessage($folderid, $id);
                             } catch (Horde_ActiveSync_Exception $e) {
                                 $this->_endBuffer();
                                 return false;
                             }
                     }
             }
         } catch (Horde_Exception $e) {
             $this->_logger->err($e->getMessage());
             $this->_endBuffer();
             return array('id' => '', 'mod' => 0, 'flags' => 1);
         }
         $this->_modCache[$statKey] = $mod;
     }
     $message = array();
     $message['id'] = $id;
     $message['mod'] = $mod;
     $message['flags'] = 1;
     $this->_endBuffer();
     return $message;
 }