Method | Description | |
---|---|---|
arrayFlipAndCombine ( array $array ) : array | null | Takes an array and returns a flip, making values the keys and making the keys values. | |
beginTransaction ( ) | Begin a log transaction. | |
delete ( int[] | string $LogIDs ) | Purge entries from the log. | |
endTransaction ( ) | End a log transaction. | |
formatConfiguration ( array $Data ) : string | Format a configuration subtree. | |
formatContent ( array $Log ) : string | Format the content of a log file. | |
formatDiff ( string $Old, string $New, string $Method = 'html' ) : string | array | Format a diff of an edit. | |
formatKey ( string $Key, array $Data ) : string | Format a specific column from the log. | |
formatRecord ( string[] $Keys, array $Data ) : string | Format a record that the log points to. | |
getCountWhere ( array $Where ) : integer | Get the count of log entries matching a query. | |
getIDs ( int[] | string $IDs ) : array | Get the log rows by array of IDs. | |
getOperationCount ( string $Operation ) : integer | A wrapper for GetCountWhere that takes care of caching specific operation counts. | |
getWhere ( array | false $Where = false, string $OrderFields = '', string $OrderDirection = 'asc', boolean $Offset = false, boolean $Limit = false ) : array | Get log rows by a query. | |
insert ( string $Operation, string $RecordType, array $Data, array $Options = [] ) : integer | false | Log an operation into the log table. | |
logChange ( string $Operation, string $RecordType, array $NewData, array | null $OldData = null ) | Log a record edit. | |
recalculate ( ) | Recalculate a record after a log operation. | |
restore ( array | integer $Log, boolean $DeleteLog = true ) | Restore an entry from the log. |
Method | Description | |
---|---|---|
instance ( ) : LogModel | Returns the shared instance of this class. | |
logValue ( array $Data, string $LogKey, string $BakKey1 = '', string $BakKey2 = '' ) : mixed | Get a value from a log entry. | |
restoreOne ( array $Log, boolean $DeleteLog = true ) | Restores a single entry from the log. |
public formatConfiguration ( array $Data ) : string | ||
$Data | array | The data to format. |
return | string | Returns the formatted entry. |
public formatContent ( array $Log ) : string | ||
$Log | array | The log entry to format. |
return | string | Returns the formatted log entry. |
public formatDiff ( string $Old, string $New, string $Method = 'html' ) : string | array | ||
$Old | string | The record before the edit. |
$New | string | The record after the edit. |
$Method | string | Either **normal**, **html**, or **mixed**. |
return | string | array | Returns the diff formatted according to {@link $Method}. |
public formatRecord ( string[] $Keys, array $Data ) : string | ||
$Keys | string[] | The keys to use from the record. |
$Data | array | The log row. |
return | string | Returns the formatted record. |
public getCountWhere ( array $Where ) : integer | ||
$Where | array | The filter. |
return | integer | Returns the count. |
public getOperationCount ( string $Operation ) : integer | ||
$Operation | string | Comma-delimited list of operation types to get (sum of) counts for. |
return | integer | Returns a count. |
public getWhere ( array | false $Where = false, string $OrderFields = '', string $OrderDirection = 'asc', boolean $Offset = false, boolean $Limit = false ) : array | ||
$Where | array | false | The where filter. |
$OrderFields | string | The fields to order by. |
$OrderDirection | string | The order direction. |
$Offset | boolean | The database offset. |
$Limit | boolean | The database limit. |
return | array | Returns a data set. |
public static insert ( string $Operation, string $RecordType, array $Data, array $Options = [] ) : integer | false | ||
$Operation | string | The operation being performed. This is usually one of: - Delete: The record has been deleted. - Edit: The record has been edited. - Spam: The record has been marked spam. - Moderate: The record requires moderation. - Pending: The record needs pre-moderation. |
$RecordType | string | The type of record being logged. This usually correspond to the tablename of the record. |
$Data | array | The record data. - If you are logging just one row then pass the row as an array. - You can pass an additional _New element to tell the logger what the new data is. |
$Options | array | Additional options to affect the insert. |
return | integer | false | The log ID or **false** if there was a problem. |
public static logChange ( string $Operation, string $RecordType, array $NewData, array | null $OldData = null ) | ||
$Operation | string | The specific operation being logged. |
$RecordType | string | The type of record. This matches the name of the record's table. |
$NewData | array | The record after the edit. |
$OldData | array | null | The record before the edit. |