Public Member Functions | |
| EventLog ($DB, $UserId=-1, $LoggingEnabled=TRUE) | |
| Object constructor. | |
| Log ($Type, $DataOne="", $DataTwo="") | |
| Add event to log. | |
| FindEvents ($StartDate=NULL, $EndDate=NULL, $EventCount=999999999, $EventType) | |
| Retrieve specified range of events. | |
| ExcludeUsersWithPrivilegesForFind ($Operator, $Value) | |
| Add privilege to exclude from FindEvents() results. | |
| AddSqlConditionForFind ($Conditions) | |
| Add SQL condition to apply to FindEvents(). | |
| LimitFindToUser ($UserId=NULL) | |
| Limit FindEvents() results to user with specified ID. | |
| ModifyEvents ($EventType, $EventDate, $UserId, $DataOne=NULL, $DataTwo=NULL, $Condition=NULL) | |
| Modify existing events. | |
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.
| 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.
| DB | Database object. | |
| UserId | ID of current user. (OPTIONAL) | |
| 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.
| Operator | Numerical comparison operator to use with privilege (for example: "=", ">", "<=", "!=" etc).. | |
| 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.
| StartDate | Start date of range to search in SQL-compatible format. (OPTIONAL, pass NULL to omit) | |
| EndDate | End date of range to search in SQL-compatible format. (OPTIONAL, pass NULL to omit) | |
| EventCount | Maximum number of events to retrieve. (OPTIONAL) | |
| 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.
| 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.
| Type | Type of event. | |
| DataOne | First data value for event. (OPTIONAL) | |
| 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.
| EventType | Code for type of events to modify. | |
| EventDate | SQL-compatible date for events to modify. | |
| UserId | ID for user for events to modify. | |
| DataOne | New value for DataOne field. (OPTIONAL, pass in NULL to not modify field) | |
| DataTwo | New value for DataTwo field. (OPTIONAL, pass in NULL to not modify field) | |
| Condition | SQL condition to apply to select events to modify. |
Definition at line 236 of file EventLog.php.