$getCount
$getCount : integer
Counts how often _getHistory() is called.
Used for testing caching.
The Horde_History_Mock class provides a method of tracking changes in Horde objects, stored in memory.
log(string $guid, array $attributes = array(), boolean $replaceAction = false)
Logs an event to an item's history log.
The item must be uniquely identified by $guid. Any other details about the event are passed in $attributes. Standard suggested attributes are:
string | $guid | The unique identifier of the entry to add to. |
array | $attributes | The hash of name => value entries that describe this event. |
boolean | $replaceAction | If $attributes['action'] is already present in the item's history log, update that entry instead of creating a new one. |
getHistory(string $guid) : \Horde_History_Log
Returns a Horde_History_Log corresponding to the named history entry, with the data retrieved appropriately.
string | $guid | The name of the history entry to retrieve. |
A Horde_History_Log object.
_getHistory(string $guid) : \Horde_History_Log
Returns a Horde_History_Log corresponding to the named history entry, with the data retrieved appropriately.
string | $guid | The name of the history entry to retrieve. |
A Horde_History_Log object.
getByTimestamp(string $cmp, integer $ts, array $filters = array(), string $parent = null) : array
Finds history objects by timestamp, and optionally filter on other fields as well.
string | $cmp | The comparison operator (<, >, <=, >=, or =) to check the timestamps with. |
integer | $ts | The timestamp to compare against. |
array | $filters | An array of additional (ANDed) criteria. Each array value should be an array with 3 entries:
|
string | $parent | The parent history to start searching at. If non-empty, will be searched for with a LIKE '$parent:%' clause. |
An array of history object ids, or an empty array if none matched the criteria.
getByModSeq(integer $start, integer $end, array $filters = array(), string $parent = null) : array
Return history objects with changes during a modseq interval, and optionally filtered on other fields as well.
integer | $start | The (exclusive) start of the modseq range. |
integer | $end | The (inclusive) end of the modseq range. |
array | $filters | An array of additional (ANDed) criteria. Each array value should be an array with 3 entries:
|
string | $parent | The parent history to start searching at. If non-empty, will be searched for with a LIKE '$parent:%' clause. |
An array of history object ids, or an empty array if none matched the criteria.
_getByTimestamp(string $cmp, integer $ts, array $filters = array(), string $parent = null) : array
Finds history objects by timestamp, and optionally filter on other fields as well.
string | $cmp | The comparison operator (<, >, <=, >=, or =) to check the timestamps with. |
integer | $ts | The timestamp to compare against. |
array | $filters | An array of additional (ANDed) criteria. Each array value should be an array with 3 entries:
|
string | $parent | The parent history to start searching at. If non-empty, will be searched for with a LIKE '$parent:%' clause. |
An array of history object ids, or an empty array if none matched the criteria.
getActionTimestamp(string $guid, string $action) : integer
Gets the timestamp of the most recent change to $guid.
string | $guid | The name of the history entry to retrieve. |
string | $action | An action: 'add', 'modify', 'delete', etc. |
The timestamp, or 0 if no matching entry is found.
getHighestModSeq(string $parent = null) : integer|boolean
Return the current value of the modseq. We take the MAX of the horde_histories table instead of the value of the horde_histories_modseq table to ensure we never miss an entry if we query the history system between the time we call nextModSeq() and the time the new entry is written.
string | $parent | Restrict to entries a specific parent. |
The highest used modseq value, false if no history.
getActionModSeq(string $guid, string $action) : integer
Gets the modseq of the most recent change to $guid
string | $guid | The name of the history entry to retrieve. |
string | $action | An action: 'add', 'modify', 'delete', etc. |
The modseq, or 0 if no matching entry is found.
getLatestEntry(string $guid, boolean $use_ts = false) : array|boolean
Gets the latest entry of $guid
string | $guid | The name of the history entry to retrieve. |
boolean | $use_ts | 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. |
The latest history entry, or false if $guid does not exist.
_log(\Horde_History_Log $history, array $attributes, boolean $replaceAction = false)
Logs an event to an item's history log. Any other details about the event are passed in $attributes.
\Horde_History_Log | $history | The history item to add to. |
array | $attributes | The hash of name => value entries that describe this event. |
boolean | $replaceAction | If $attributes['action'] is already present in the item's history log, update that entry instead of creating a new one. |
_getByModSeq(integer $start, integer $end, array $filters = array(), string $parent = null) : array
Return history objects with changes during a modseq interval, and optionally filtered on other fields as well.
integer | $start | The start of the modseq range. |
integer | $end | The end of the modseq range. |
array | $filters | An array of additional (ANDed) criteria. Each array value should be an array with 3 entries:
|
string | $parent | The parent history to start searching at. If non-empty, will be searched for with a LIKE '$parent:%' clause. |
An array of history object ids, or an empty array if none matched the criteria.