PHP 클래스 Horde_History_Sql, horde

저자: Chuck Hagenbuch ([email protected])
상속: extends Horde_History
파일 보기 프로젝트 열기: horde/horde

보호된 프로퍼티들

프로퍼티 타입 설명
$_db Horde_Db_Adapter Horde_Db_Adapter instance to manage the history.

공개 메소드들

메소드 설명
__construct ( string $auth, Horde_Db_Adapter $db ) Constructor.
_getByTimestamp ( string $cmp, integer $ts, array $filters = [], string $parent = null ) : array Finds history objects by timestamp, and optionally filtered on other fields as well.
_getHistory ( string $guid ) : Horde_History_Log Returns a Horde_History_Log corresponding to the named history entry, with the data retrieved appropriately.
getActionTimestamp ( string $guid, string $action ) : integer Returns the timestamp of the most recent change to $guid.
getHighestModSeq ( string $parent = null ) : integer | boolean Returns the current value of the modseq.
getLatestEntry ( string $guid, boolean $use_ts = false ) : array | boolean Returns the latest entry of $guid.
removeByNames ( array $names ) Removes one or more history entries by name.

보호된 메소드들

메소드 설명
_getByModSeq ( integer $start, integer $end, array $filters = [], string $parent = null ) : array Returns history objects with changes during a modseq interval, and optionally filtered on other fields as well.
_log ( Horde_History_Log $history, array $attributes, boolean $replaceAction = false ) Logs an event to an item's history log.
_nextModSeq ( ) : integer Increments, and returns, the modseq value.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $auth, Horde_Db_Adapter $db )
$auth string The current user.
$db Horde_Db_Adapter The database connection.

_getByModSeq() 보호된 메소드

Note: For BC reasons, the results are returned keyed by the object UID, with a (fairly useless) history_id as the value. @todo This should be changed for Horde 6.
protected _getByModSeq ( integer $start, integer $end, array $filters = [], string $parent = null ) : array
$start integer The (exclusive) start of the modseq range.
$end integer The (inclusive) end of the modseq range.
$filters array An array of additional (ANDed) criteria. Each array value should be an array with 3 entries: - field: the history field being compared (i.e. 'action'). - op: the operator to compare this field with. - value: the value to check for (i.e. 'add').
$parent string The parent history to start searching at. If non-empty, will be searched for with a LIKE '$parent:%' clause.
리턴 array An array of history object ids that have had at least one match for the given $filters. Will return empty array if none matched the criteria. If the same GUID has multiple matches withing the range requested, there is no guarantee which entry will be returned.

_getByTimestamp() 공개 메소드

Note: For BC reasons, the results are returned keyed by the object UID, with a (fairly useless) history_id as the value. @todo This should be changed for Horde 6.
public _getByTimestamp ( string $cmp, integer $ts, array $filters = [], string $parent = null ) : array
$cmp string The comparison operator (<, >, <=, >=, or =) to check the timestamps with.
$ts integer The timestamp to compare against.
$filters array An array of additional (ANDed) criteria. Each array value should be an array with 3 entries: - field: the history field being compared (i.e. 'action'). - op: the operator to compare this field with. - value: the value to check for (i.e. 'add').
$parent string The parent history to start searching at. If non-empty, will be searched for with a LIKE '$parent:%' clause.
리턴 array An array of history object ids that have had at least one match for the given $filters. Will return empty array if none matched the criteria. If the same GUID has multiple matches withing the range requested, there is no guarantee which entry will be returned.

_getHistory() 공개 메소드

Returns a Horde_History_Log corresponding to the named history entry, with the data retrieved appropriately.
public _getHistory ( string $guid ) : Horde_History_Log
$guid string The name of the history entry to retrieve.
리턴 Horde_History_Log A Horde_History_Log object.

_log() 보호된 메소드

Any other details about the event are passed in $attributes.
protected _log ( Horde_History_Log $history, array $attributes, boolean $replaceAction = false )
$history Horde_History_Log The history item to add to.
$attributes array The hash of name => value entries that describe this event.
$replaceAction boolean If $attributes['action'] is already present in the item's history log, update that entry instead of creating a new one.

_nextModSeq() 보호된 메소드

Increments, and returns, the modseq value.
protected _nextModSeq ( ) : integer
리턴 integer The new modseq value.

getActionTimestamp() 공개 메소드

Returns the timestamp of the most recent change to $guid.
public getActionTimestamp ( string $guid, string $action ) : integer
$guid string The name of the history entry to retrieve.
$action string An action: 'add', 'modify', 'delete', etc.
리턴 integer The timestamp, or 0 if no matching entry is found.

getHighestModSeq() 공개 메소드

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.
public getHighestModSeq ( string $parent = null ) : integer | boolean
$parent string Restrict to entries a specific parent.
리턴 integer | boolean The highest used modseq value, false if no history.

getLatestEntry() 공개 메소드

Returns the latest entry of $guid.
부터: 2.2.0
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.
리턴 array | boolean The latest history entry, or false if $guid does not exist.

removeByNames() 공개 메소드

Removes one or more history entries by name.
public removeByNames ( array $names )
$names array The history entries to remove.

프로퍼티 상세

$_db 보호되어 있는 프로퍼티

Horde_Db_Adapter instance to manage the history.
protected Horde_Db_Adapter $_db
리턴 Horde_Db_Adapter