CWIS Developer Documentation
|
Class for storing and retrieving event information from database. More...
Public Member Functions | |
EventLog ($DB, $UserId=-1, $LoggingEnabled=TRUE) | |
Object constructor. More... | |
Log ($Type, $DataOne="", $DataTwo="") | |
Add event to log. More... | |
FindEvents ($StartDate=NULL, $EndDate=NULL, $EventCount=999999999, $EventType) | |
Retrieve specified range of events. More... | |
ExcludeUsersWithPrivilegesForFind ($Operator, $Value) | |
Add privilege to exclude from FindEvents() results. More... | |
AddSqlConditionForFind ($Conditions) | |
Add SQL condition to apply to FindEvents(). More... | |
LimitFindToUser ($UserId=NULL) | |
Limit FindEvents() results to user with specified ID. More... | |
ModifyEvents ($EventType, $EventDate, $UserId, $DataOne=NULL, $DataTwo=NULL, $Condition=NULL) | |
Modify existing events. More... | |
Class for storing and retrieving event information from database.
Definition at line 22 of file EventLog.php.
EventLog::AddSqlConditionForFind | ( | $Conditions | ) |
Add SQL condition to apply to FindEvents().
Multiple conditions are ANDed. Pass in NULL to clear all current conditions.
string | $Conditions | String with single condition or array with multiple conditions. |
Definition at line 192 of file EventLog.php.
Referenced by LimitFindToUser().
EventLog::EventLog | ( | $DB, | |
$UserId = -1 , |
|||
$LoggingEnabled = TRUE |
|||
) |
Object constructor.
Database | $DB | Database object. |
int | $UserId | ID of current user. (OPTIONAL) |
bool | $LoggingEnabled | Whether event logging is currently enabled. (OPTIONAL, defaults to TRUE) |
Definition at line 33 of file EventLog.php.
Referenced by SPTEventLog\SPTEventLog().
EventLog::ExcludeUsersWithPrivilegesForFind | ( | $Operator, | |
$Value | |||
) |
Add privilege to exclude from FindEvents() results.
Operators should be SQL-compatible (i.e. "=" for equals, not "=="). Multiple operator/value conditions are ORed together. Pass in NULL for Operator and NULL for Value to clear all current exclusions.
string | $Operator | Numerical comparison operator to use with privilege (for example: "=", ">", "<=", "!=" etc).. |
int | $Value | Privilege value to compare. |
Definition at line 169 of file EventLog.php.
EventLog::FindEvents | ( | $StartDate = NULL , |
|
$EndDate = NULL , |
|||
$EventCount = 999999999 , |
|||
$EventType | |||
) |
Retrieve specified range of events.
Takes a variable number of arguments, with as many EventType parameters as desired. Dates are inclusive.
string | $StartDate | Start date of range to search in SQL-compatible format. (OPTIONAL, pass NULL to omit) |
string | $EndDate | End date of range to search in SQL-compatible format. (OPTIONAL, pass NULL to omit) |
int | $EventCount | Maximum number of events to retrieve. (OPTIONAL) |
int | $EventType | Type of event to find. (OPTIONAL) |
Definition at line 72 of file EventLog.php.
EventLog::LimitFindToUser | ( | $UserId = NULL | ) |
Limit FindEvents() results to user with specified ID.
int | $UserId | User ID to return results for. (OPTIONAL, defaults to NULL which uses user ID passed in to EventLog()) |
Definition at line 217 of file EventLog.php.
References AddSqlConditionForFind().
EventLog::Log | ( | $Type, | |
$DataOne = "" , |
|||
$DataTwo = "" |
|||
) |
Add event to log.
int | $Type | Type of event. |
mixed | $DataOne | First data value for event. (OPTIONAL) |
mixed | $DataTwo | Second data value for event. (OPTIONAL) |
Definition at line 46 of file EventLog.php.
EventLog::ModifyEvents | ( | $EventType, | |
$EventDate, | |||
$UserId, | |||
$DataOne = NULL , |
|||
$DataTwo = NULL , |
|||
$Condition = NULL |
|||
) |
Modify existing events.
All parameters are ANDed to select which events are modified.
int | $EventType | Code for type of events to modify. |
string | $EventDate | SQL-compatible date for events to modify. |
int | $UserId | ID for user for events to modify. |
mixed | $DataOne | New value for DataOne field. (OPTIONAL, pass in NULL to not modify field) |
mixed | $DataTwo | New value for DataTwo field. (OPTIONAL, pass in NULL to not modify field) |
string | $Condition | SQL condition to apply to select events to modify. |
Definition at line 236 of file EventLog.php.