Gets the latest entry of $guid
public getLatestEntry ( string $guid, boolean $use_ts = false ) : array | boolean | ||
$guid | string | The name of the history entry to retrieve. |
$use_ts | boolean | If false we use the 'modseq' field to determine the latest entry. If true we use the timestamp instead of modseq to determine the latest entry. Note: Only 'modseq' can give a definitive answer. |
return | array | boolean | The latest history entry, or false if $guid does not exist. |
/** * Update the history log for an object. * * @param string $object The object ID. * @param string $bid The backend ID of the object. * @param boolean $force Force update */ protected function _updateLog($object, $bid, $force = false) { $last = $this->_history->getLatestEntry($object); if ($last === false) { // New, unknown object $this->_logger->debug(sprintf('[KOLAB_STORAGE] New object to log in Horde_History: %s, uid: %d', $object, $bid)); $this->_history->log($object, array('action' => 'add', 'bid' => $bid), true); } else { // If the last action for this object was 'delete', we issue an 'add'. // Objects can vanish and re-appear using the same object uid. // (a foreign client is sending an update over a slow link) if ($last['action'] == 'delete') { $this->_logger->debug(sprintf('[KOLAB_STORAGE] Re-adding previously deleted object in Horde_History: %s, uid: %d', $object, $bid)); $this->_history->log($object, array('action' => 'add', 'bid' => $bid), true); } if (!isset($last['bid']) || $last['bid'] != $bid || $force) { $this->_logger->debug(sprintf('[KOLAB_STORAGE] Modifying object in Horde_History: %s, uid: %d, force: %d', $object, $bid, $force)); $this->_history->log($object, array('action' => 'modify', 'bid' => $bid), true); } } }
/** * @see Horde_History::getLatestEntry() */ public function getLatestEntry($guid, $use_ts = false) { return $this->_history->getLatestEntry($guid, $use_ts); }