PHP 클래스 Horde_History, horde

Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
저자: Chuck Hagenbuch ([email protected])
저자: Gunnar Wrobel ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_auth string The current user.
$_cache Horde_Cache Cache driver object.
$_logger Horde_Log_Logger Our log handler.

공개 메소드들

메소드 설명
__construct ( string $auth ) Constructor.
_getByTimestamp ( string $cmp, integer $ts, array $filters = [], string $parent = null ) : array Finds history objects by timestamp, and optionally filter 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.
getActionModSeq ( string $guid, string $action ) : integer Gets the modseq of the most recent change to $guid
getActionTimestamp ( string $guid, string $action ) : integer Gets the timestamp of the most recent change to $guid.
getByModSeq ( integer $start, integer $end, array $filters = [], string $parent = null ) : array Return history objects with changes during a modseq interval, and optionally filtered on other fields as well.
getByTimestamp ( string $cmp, integer $ts, array $filters = [], string $parent = null ) : array Finds history objects by timestamp, and optionally filter on other fields as well.
getHighestModSeq ( string $parent = null ) : integer Return the maximum modification sequence. To be overridden in concrete class.
getHistory ( string $guid ) : Horde_History_Log Returns a Horde_History_Log corresponding to the named history entry, with the data retrieved appropriately.
getLatestEntry ( string $guid, boolean $use_ts = false ) : array | boolean Gets the latest entry of $guid
log ( string $guid, array $attributes = [], boolean $replaceAction = false ) Logs an event to an item's history log.
removeByNames ( array $names ) Removes one or more history entries by name.
removeByParent ( string $parent ) Remove one or more history entries by parent.
setCache ( Horde_Cache $cache ) Set Cache object.
setLogger ( Horde_Log_Logger $logger ) : null Set the log handler.

보호된 메소드들

메소드 설명
_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.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $auth )
$auth string The current user.

_getByTimestamp() 추상적인 공개 메소드

Finds history objects by timestamp, and optionally filter on other fields as well.
abstract 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, or an empty array if none matched the criteria.

_getHistory() 추상적인 공개 메소드

Returns a Horde_History_Log corresponding to the named history entry, with the data retrieved appropriately.
abstract 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() 추상적인 보호된 메소드

Logs an event to an item's history log. Any other details about the event are passed in $attributes.
abstract 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.

getActionModSeq() 공개 메소드

Gets the modseq of the most recent change to $guid
부터: 2.1.0
public getActionModSeq ( 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 modseq, or 0 if no matching entry is found.

getActionTimestamp() 공개 메소드

Gets 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.

getByModSeq() 공개 메소드

Return history objects with changes during a modseq interval, and optionally filtered on other fields as well.
public 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, or an empty array if none matched the criteria.

getByTimestamp() 공개 메소드

Finds history objects by timestamp, and optionally filter on other fields as well.
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, or an empty array if none matched the criteria.

getHighestModSeq() 공개 메소드

Return the maximum modification sequence. To be overridden in concrete class.
부터: 2.1.0
public getHighestModSeq ( string $parent = null ) : integer
$parent string Restrict to entries a specific parent.
리턴 integer The modseq

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.

getLatestEntry() 공개 메소드

Gets 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.

log() 공개 메소드

The item must be uniquely identified by $guid. Any other details about the event are passed in $attributes. Standard suggested attributes are: - who: The id of the user that performed the action (will be added automatically if not present). - ts: Timestamp of the action (this will be added automatically if it is not present).
public log ( string $guid, array $attributes = [], boolean $replaceAction = false )
$guid string The unique identifier of the entry 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.

removeByNames() 추상적인 공개 메소드

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

removeByParent() 공개 메소드

Remove one or more history entries by parent.
public removeByParent ( string $parent )
$parent string The parent name to remove.

setCache() 공개 메소드

Set Cache object.
부터: 2.1.0
public setCache ( Horde_Cache $cache )
$cache Horde_Cache The cache instance.

setLogger() 공개 메소드

Set the log handler.
public setLogger ( Horde_Log_Logger $logger ) : null
$logger Horde_Log_Logger The log handler.
리턴 null

프로퍼티 상세

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

The current user.
protected string $_auth
리턴 string

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

Cache driver object.
protected Horde_Cache $_cache
리턴 Horde_Cache

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

Our log handler.
protected Horde_Log_Logger $_logger
리턴 Horde_Log_Logger