public
|
#
__construct( )
Initialize Logs
Overrides
|
public
integer
|
#
addEmail( array $vars )
Logs a single email
Parameters
- $vars
array $vars An array of variable log info, including - company_id The company ID -
to_client_id The client ID this log is to (optional) - from_staff_id The staff
ID this log is from (optional) - to_address A To email address - from_address A
From email address - from_name A from name - cc_address A comma separated list
of CC addresses (optional) - subject An email subject - body_text Plain text
email body (optional) - body_html HTML email body (optional) - sent Whether this
email has been sent, either 0 (default) or 1 (optional) - error A message to be
used on error
Returns
integer The email log ID for this record, void if error
|
public
integer
|
#
addGateway( array $vars )
Logs a gateway requests
Parameters
- $vars
array $vars An array of variable log info, including - staff_id The staff ID -
gateway_id The gateway ID - direction The direction type, either 'input'
(default) or 'output' (optional) - url The URL - data Gateway data (optional) -
from_name A from name - status The status type, either 'error' (default) or
'success' (optional) - group The gateway group
Returns
integer The gateway log ID for this record, void if error
|
public
integer
|
#
addModule( array $vars )
Logs a module request
Parameters
- $vars
array $vars An array of variable log info, including - staff_id The staff ID -
module_id The module ID - direction The direction type, either 'input' (default)
or 'output' (optional) - url The URL - data Gateway data (optional) - from_name
A from name - status The status type, either 'error' (default) or 'success'
(optional) - group The module group
Returns
integer The module log ID for this record, void if error
|
public
integer
|
#
addUser( array $vars )
Logs a user log in
Parameters
- $vars
array $vars An array of variable log info, including - user_id The user ID -
ip_address The IP address - company_id The company ID - result The result of the
login attempt: - success - failure
Returns
integer The user log ID for this record, void if error
|
public
|
#
updateUser( integer $user_id, string $ip_address, integer $company_id )
Updates the user log for a user
Updates the user log for a user
Parameters
- $user_id
integer $user_id The user's ID
- $ip_address
string $ip_address The user's IP address
- $company_id
integer $company_id The company ID
|
public
integer
|
#
addContact( array $vars )
Logs a change to contact information
Logs a change to contact information
Parameters
- $vars
array $vars An array of contact change data including: - contact_id The ID of the
contact that has been modified - fields An array of fields where the key if the
field that changed and contains: - prev The value of the field prior to the
update - cur The value of that field after the update
Returns
integer The contact log ID for this record, void if error
|
public
integer
|
#
addAccountAccess( array $vars )
Logs access to customer payment account details
Logs access to customer payment account details
Parameters
- $vars
array $vars An array of access information including: - staff_id The ID of the staff
member that accessed the account details - first_name The first name of the
account holder - last_name The last name of the account holder - type The
account type ('ach','cc') - account_type The ACH or CC account type (i.e.
'savings', or 'visa') - last4 The encrypted last 4 digits of the account number
(must be encrypted using AppModel::systemEncrypt()) - account_id The ID of the
account accessed (accounts_ach.id or accounts_cc.id)
Returns
integer The account access log ID for this record, void if error
See
|
public
integer
|
#
addCron( array $vars )
Logs cron task details
Parameters
- $vars
array $vars An array of cron task information including: - run_id The cron task run ID
- event This cron log event (optional, default "") - group The group associated
with this cron event - output The output from running this task (optional) -
start_date The date time that the cron task began running - end_date The date
time that the cron task completed (optional)
Returns
integer The cron log ID, or void on error
|
public
|
#
updateCron( integer $cron_task_run_id, string $group, string $event = "", array $vars = array() )
Updates the cron log for a particular logged task
Updates the cron log for a particular logged task
Parameters
- $cron_task_run_id
integer $cron_task_run_id The cron task run ID of the logged task
- $group
string $group The group of the logged task
- $event
string $event The cron log event (optional, default "")
- $vars
array $vars An array of cron task information including: - output The output from
running this task (optional) - end_date The date time that the cron task
completed (optional)
|
public
integer
|
#
addTransaction( array $vars )
Logs a change to transaction information
Logs a change to transaction information
Parameters
- $vars
array $vars An array of transaction change data including: - staff_id The ID of the
staff member that made the change (optional) - transaction_id The ID of the
transaction that has been modified - fields An array of fields where the key if
the field that changed and contains: - prev The value of the field prior to the
update - cur The value of that field after the update
Returns
integer The transaction log ID for this record, void if error
|
public
mixed
|
#
getModuleList( integer $page = 1, array $order_by = array('date_added'=>"DESC"), boolean $group_results = false )
Fetches a list of all module log entries
Fetches a list of all module log entries
Parameters
- $page
integer $page The page to return results for (optional, default 1)
- $order_by
string $order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
- $group_results
boolean $group_results True to group results by group, false to not group at all (useful
for page nav, optional, default false)
Returns
mixed An array of stdClass objects representing module logs, or false if no logs found
|
public
integer
|
#
getModuleListCount( boolean $group_results = false )
Returns the total number of module log entries returned from
Logs::getModuleList(), useful in constructing pagination for the getModuleList()
method.
Returns the total number of module log entries returned from
Logs::getModuleList(), useful in constructing pagination for the getModuleList()
method.
Parameters
- $group_results
boolean $group_results True to group results by group, false to not group at all (useful
for page nav, optional, default false)
Returns
integer The total number of module logs
See
|
public
mixed
|
#
getModuleGroupList( string $group )
Retrieves a list of all module log entries for a particular module group
Retrieves a list of all module log entries for a particular module group
Parameters
- $group
string $group The name of the group whose logs to retrieve
Returns
mixed An array of stdClass objects representing module logs for a particular group,
false otherwise
|
private
Record
|
#
getModuleLogs( string $group = null, boolean $group_results = false )
Partially constructs the query required by Logs::getModuleList(), and
Logs::getModuleListCount()
Partially constructs the query required by Logs::getModuleList(), and
Logs::getModuleListCount()
Parameters
- $group
string $group The name of the group whose logs to retrieve (optional, default null for
all)
- $group_results
boolean $group_results True to group results by group, false to not group at all (useful
for page nav, optional, default false)
Returns
Record
The partially constructed query Record object
|
public
integer
|
#
deleteModuleLogs( string $datetime )
Deletes all of the module logs up until the date given for the current
company
Deletes all of the module logs up until the date given for the current
company
Parameters
- $datetime
string $datetime The datetime of the earliest log to keep. All older logs will be
purged
Returns
integer The number of records deleted
|
public
mixed
|
#
getGatewayList( integer $page = 1, array $order_by = array('date_added'=>"DESC"), boolean $group_results = false )
Fetches a list of all gateway log entries
Fetches a list of all gateway log entries
Parameters
- $page
integer $page The page to return results for (optional, default 1)
- $order_by
string $order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
- $group_results
boolean $group_results True to group results by group, false to not group at all (useful
for page nav, optional, default false)
Returns
mixed An array of stdClass objects representing gateway logs, or false if no logs
found
|
public
integer
|
#
getGatewayListCount( boolean $group_results = false )
Returns the total number of gateway log entries returned from
Logs::getGatewayList(), useful in constructing pagination for the
getGatewayList() method.
Returns the total number of gateway log entries returned from
Logs::getGatewayList(), useful in constructing pagination for the
getGatewayList() method.
Parameters
- $group_results
boolean $group_results True to group results by group, false to not group at all (useful
for page nav, optional, default false)
Returns
integer The total number of gateway logs
See
|
public
mixed
|
#
getGatewayGroupList( string $group )
Retrieves a list of all gateway log entries for a particular gateway
group
Retrieves a list of all gateway log entries for a particular gateway
group
Parameters
- $group
string $group The name of the group whose logs to retrieve
Returns
mixed An array of stdClass objects representing gateway logs for a particular group,
false otherwise
|
private
Record
|
#
getGatewayLogs( string $group = null, boolean $group_results = false )
Partially constructs the query required by Logs::getGatewayList(), and
Logs::getGatewayListCount()
Partially constructs the query required by Logs::getGatewayList(), and
Logs::getGatewayListCount()
Parameters
- $group
string $group The name of the group whose logs to retrieve (optional, default null for
all)
- $group_results
boolean $group_results True to group results by group, false to not group at all (useful
for page nav, optional, default false)
Returns
Record
The partially constructed query Record object
|
public
integer
|
#
deleteGatewayLogs( string $datetime )
Deletes all of the gateway logs up until the date given for the current
company
Deletes all of the gateway logs up until the date given for the current
company
Parameters
- $datetime
string $datetime The datetime of the earliest log to keep. All older logs will be
purged
Returns
integer The number of records deleted
|
public
mixed
|
#
getEmail( integer $email_log_id )
Fetches a single email log
Fetches a single email log
Parameters
- $email_log_id
integer $email_log_id The email log ID of the email to get
Returns
mixed An stdClass representing the email log, or false if none found
|
public
array
|
#
getEmailList( integer $page = 1, array $order_by = array('date_sent'=>"DESC") )
Fetches a list of all email log entries
Fetches a list of all email log entries
Parameters
- $page
integer $page The page to return results for (optional, default 1)
- $order_by
string $order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
array An array of stdClass objects representing email logs
|
public
integer
|
#
getEmailListCount( )
Returns the total number of email log entries returned from
Logs::getEmailList(), useful in constructing pagination for the getEmailList()
method.
Returns the total number of email log entries returned from
Logs::getEmailList(), useful in constructing pagination for the getEmailList()
method.
Returns
integer The total number of email logs
See
|
private
Record
|
#
getEmailLogs( )
Partially constructs the query required by Logs::getEmailList(), and
Logs::getEmailListCount()
Partially constructs the query required by Logs::getEmailList(), and
Logs::getEmailListCount()
Returns
Record
The partially constructed query Record object
|
public
integer
|
#
deleteEmailLogs( string $datetime )
Deletes all of the email logs up until the date given for the current
company
Deletes all of the email logs up until the date given for the current
company
Parameters
- $datetime
string $datetime The datetime of the earliest log to keep. All older logs will be
purged
Returns
integer The number of records deleted
|
public
mixed
|
#
getUserList( integer $page = 1, array $order_by = array('date_added'=>"DESC") )
Fetches a list of all user log entries
Fetches a list of all user log entries
Parameters
- $page
integer $page The page to return results for (optional, default 1)
- $order_by
string $order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
mixed An array of stdClass objects representing user logs, or false if no logs found
|
public
integer
|
#
getUserListCount( )
Returns the total number of user log entries returned from
Logs::getUserList(), useful in constructing pagination for the getUserList()
method.
Returns the total number of user log entries returned from
Logs::getUserList(), useful in constructing pagination for the getUserList()
method.
Returns
integer The total number of user logs
See
|
private
Record
|
#
getUserLogs( )
Partially constructs the query required by Logs::getUserList(), and
Logs::getUserListCount()
Partially constructs the query required by Logs::getUserList(), and
Logs::getUserListCount()
Returns
Record
The partially constructed query Record object
|
public
integer
|
#
deleteUserLogs( string $datetime )
Deletes all of the users logs up until the date given for the current
company
Deletes all of the users logs up until the date given for the current
company
Parameters
- $datetime
string $datetime The datetime of the earliest log to keep. All older logs will be
purged
Returns
integer The number of records deleted
|
public
mixed
|
#
getContactList( integer $page = 1, array $order_by = array('date_changed'=>"DESC") )
Fetches a list of all contact log entries
Fetches a list of all contact log entries
Parameters
- $page
integer $page The page to return results for (optional, default 1)
- $order_by
string $order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
mixed An array of stdClass objects representing contact logs, or false if no logs
found
|
public
integer
|
#
getContactListCount( )
Returns the total number of contact log entries returned from
Logs::getContactList(), useful in constructing pagination for the
getContactList() method.
Returns the total number of contact log entries returned from
Logs::getContactList(), useful in constructing pagination for the
getContactList() method.
Returns
integer The total number of contact logs
See
|
private
Record
|
#
getContactLogs( )
Partially constructs the query required by Logs::getContactLogs(), and
Logs::getContactListCount()
Partially constructs the query required by Logs::getContactLogs(), and
Logs::getContactListCount()
Returns
Record
The partially constructed query Record object
|
public
integer
|
#
deleteContactLogs( string $datetime )
Deletes all of the contact logs up until the date given for the current
company
Deletes all of the contact logs up until the date given for the current
company
Parameters
- $datetime
string $datetime The datetime of the earliest log to keep. All older logs will be
purged
Returns
integer The number of records deleted
|
public
array
|
#
getTransactionList( integer $page = 1, array $order_by = array('date_changed'=>"DESC") )
Fetches a list of all transaction log entries
Fetches a list of all transaction log entries
Parameters
- $page
integer $page The page to return results for (optional, default 1)
- $order_by
string $order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
array An array of stdClass objects representing transaction logs
|
public
integer
|
#
getTransactionListCount( )
Returns the total number of transaction log entries returned from
Logs::getTransactionLogs(), useful in constructing pagination for the
getTransactionList() method.
Returns the total number of transaction log entries returned from
Logs::getTransactionLogs(), useful in constructing pagination for the
getTransactionList() method.
Returns
integer The total number of transaction logs
See
|
private
Record
|
#
getTransactionLogs( )
Partially constructs the query required by Logs::getTransactionLogs(), and
Logs::getTransactionListCount()
Partially constructs the query required by Logs::getTransactionLogs(), and
Logs::getTransactionListCount()
Returns
Record
The partially constructed query Record object
|
public
integer
|
#
deleteTransactionLogs( string $datetime )
Deletes all of the transaction logs up until the date given for the current
company
Deletes all of the transaction logs up until the date given for the current
company
Parameters
- $datetime
string $datetime The datetime of the earliest log to keep. All older logs will be
purged
Returns
integer The number of records deleted
|
public
mixed
|
#
getAccountAccessList( integer $page = 1, array $order_by = array('date_accessed'=>"DESC") )
Fetches a list of all account access log entries
Fetches a list of all account access log entries
Parameters
- $page
integer $page The page to return results for (optional, default 1)
- $order_by
string $order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
mixed An array of stdClass objects representing account access logs, or false if no
logs found
|
public
integer
|
#
getAccountAccessListCount( )
Returns the total number of contact log entries returned from
Logs::getAccountAccessList(), useful in constructing pagination for the
getAccountAccessList() method.
Returns the total number of contact log entries returned from
Logs::getAccountAccessList(), useful in constructing pagination for the
getAccountAccessList() method.
Returns
integer The total number of account access logs
See
|
public
An
|
#
getAccountAccessLog( integer $log_id )
Fetches account data that was accessed
Fetches account data that was accessed
Parameters
- $log_id
integer $log_id The access log ID
Returns
An array of stdClass objects representing an account access log, or false if no log
found
|
private
Record
|
#
getAccountAccessLogs( )
Partially constructs the query required by Logs::getAccountAccessLogs(), and
Logs::getAccountAccessListCount()
Partially constructs the query required by Logs::getAccountAccessLogs(), and
Logs::getAccountAccessListCount()
Returns
Record
The partially constructed query Record object
|
public
integer
|
#
deleteAccountAccessLogs( string $datetime )
Deletes all of the account access logs up until the date given for the
current company
Deletes all of the account access logs up until the date given for the
current company
Parameters
- $datetime
string $datetime The datetime of the earliest log to keep. All older logs will be
purged
Returns
integer The number of records deleted
|
public
mixed
|
#
getLatestCron( integer $cron_task_run_id )
Fetches the latest cron log for the given run task belonging to this
company
Fetches the latest cron log for the given run task belonging to this
company
Parameters
- $cron_task_run_id
integer $cron_task_run_id The cron task run ID
Returns
mixed An stdClass object representing the cron log for this task, or false if none
exist
|
public
mixed
|
#
getCronLastRun( integer $cron_task_key, string $plugin_dir = null, boolean $system = false )
Fetches the date at which the given cron task has last been executed
Fetches the date at which the given cron task has last been executed
Parameters
- $cron_task_key
integer $cron_task_key The cron task key
- $plugin_dir
string $plugin_dir The plugin directory of the plugin this task belongs to (optional)
- $system
boolean $system True to fetch only system cron tasks, false to fetch company cron tasks
(default false)
Returns
mixed An stdClass object representing the date this cron task was last executed, or
false if it has never run
|
public
mixed
|
#
getSystemCronLastRun( )
Fetches the date at which the system cron has last been executed
Fetches the date at which the system cron has last been executed
Returns
mixed An stdClass object representing the date the system cron has last been executed,
or false if it has never run
|
public
mixed
|
#
getCronList( integer $page = 1, array $order_by = array('start_date'=>"DESC") )
Fetches a list of all cron log entries
Fetches a list of all cron log entries
Parameters
- $page
integer $page The page to return results for (optional, default 1)
- $order_by
string $order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
mixed An array of stdClass objects representing user logs, or false if no logs found
|
public
integer
|
#
getCronListCount( )
Returns the total number of cron log entries returned from
Logs::getCronList(), useful in constructing pagination for the getCronList()
method.
Returns the total number of cron log entries returned from
Logs::getCronList(), useful in constructing pagination for the getCronList()
method.
Returns
integer The total number of cron logs
See
|
private
Record
|
#
getCronLogs( )
Partially constructs the query required by Logs::getCronLogs(), and
Logs::getCronListCount()
Partially constructs the query required by Logs::getCronLogs(), and
Logs::getCronListCount()
Returns
Record
The partially constructed query Record object
|
public
integer
|
#
deleteCronLogs( string $datetime )
Deletes all of the cron logs up until the date given for the current
company
Deletes all of the cron logs up until the date given for the current
company
Parameters
- $datetime
string $datetime The datetime of the earliest log to keep. All older logs will be
purged
Returns
integer The number of records deleted
|
private
array
|
#
getDeleteLogRules( )
Retrieves a list of log rules for deletion
Retrieves a list of log rules for deletion
Returns
array A list of log deletion rules
|
public
boolean
|
#
validateDirection( string $direction )
Validates the 'direction' field for module and gateway logs
Validates the 'direction' field for module and gateway logs
Parameters
- $direction
string $direction The direction
Returns
boolean True if direction is validated, false otherwise
|
public
boolean
|
#
validateStatus( string $status )
Validates the 'status' field for module and gateway logs
Validates the 'status' field for module and gateway logs
Parameters
- $status
string $status The status
Returns
boolean True if status is validated, false otherwise
|
public
boolean
|
#
validateType( string $type )
Validates the 'type' field for the account access logs
Validates the 'type' field for the account access logs
Parameters
- $type
string $type The type
Returns
boolean True if type is validated, false otherwise
|
public
boolean
|
#
validateCronExists( integer $cron_task_run_id )
Validates that the given cron task run ID exists
Validates that the given cron task run ID exists
Parameters
- $cron_task_run_id
integer $cron_task_run_id The cron task run ID
Returns
boolean True if the cron task run ID exists, false otherwise
|
public
boolean
|
#
validateCronLogUnique( string $group, integer $cron_task_run_id, string $event )
Checks whether the given cron task ID and group are unique
Checks whether the given cron task ID and group are unique
Parameters
- $group
string $group The cron task group
- $cron_task_run_id
integer $cron_task_run_id The cron task run ID
- $event
string $event The cron event
Returns
boolean True if the given cron task run ID, group, and event are unique, false otherwise
|
public
boolean
|
#
validateUserLogExists( integer $user_id, string $ip_address, integer $company_id )
Checks whether the given information corresponds to a valid user log
entry
Checks whether the given information corresponds to a valid user log
entry
Parameters
- $user_id
integer $user_id The user's ID to check
- $ip_address
string $ip_address The IP address of the user
- $company_id
integer $company_id The ID of the company
Returns
boolean True if the given information matches a user in the log, false otherwise
|