Methods summary
public
|
#
__construct( )
Initialize Logs
Overrides
|
public
integer
|
#
addEmail( array $vars )
Logs a single email
Parameters
- $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
An array of variable log info, including:
- staff_id The staff ID (optional)
- gateway_id The gateway ID
- direction The direction type, either 'input' (default) or 'output' (optional)
- url The URL
- data Gateway data (optional)
- 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
An array of variable log info, including:
- staff_id The staff ID (optional)
- module_id The module ID
- direction The direction type, either 'input' (default) or 'output' (optional)
- url The URL
- data Gateway data (optional)
- 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
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:
Returns
integer The user log ID for this record, void if error
|
public
integer
|
#
addMessenger( array $vars )
Logs a messenger request
Parameters
- $vars
An array of variable log info, including:
- messenger_id The messenger ID
- to_user_id The user ID this log is to (optional)
- direction The direction type, either 'input' (default) or 'output' (optional)
- data All data sent to the integrated messenger
- success Whether this messenger request has been sent, either 0 (default) or 1 (optional)
- group The messenger log group identifier
Returns
integer The messenger 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
- The user's ID
- $ip_address
- The user's IP address
- $company_id
- The company ID
|
public
integer
|
#
addContact( array $vars )
Logs a change to contact information
Logs a change to contact information
Parameters
- $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
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
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 = [] )
Updates the cron log for a particular logged task
Updates the cron log for a particular logged task
Parameters
- $cron_task_run_id
- The cron task run ID of the logged task
- $group
- The group of the logged task
- $event
- The cron log event (optional, default "")
- $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
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 is 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 = ['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
- The page to return results for (optional, default 1)
- $order_by
- The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)
- $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
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
- 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
|
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
- 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 = ['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
- The page to return results for (optional, default 1)
- $order_by
- The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)
- $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
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
- 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
|
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
- 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
- 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 = ['date_sent' => 'DESC'] )
Fetches a list of all email log entries
Fetches a list of all email log entries
Parameters
- $page
- The page to return results for (optional, default 1)
- $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
|
public
integer
|
#
deleteEmailToClient( integer $client_id )
Deletes all email logs sent to the given client
Deletes all email logs sent to the given client
Parameters
- $client_id
- The ID of the client to delete
Returns
integer The number of records deleted
|
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
- The datetime of the earliest log to keep. All older logs will be purged
Returns
integer The number of records deleted
|
public
mixed
|
#
getMessenger( integer $messenger_log_id )
Fetches a single messenger log
Fetches a single messenger log
Parameters
- $messenger_log_id
- The messenger log ID of the messenger to get
Returns
mixed An stdClass representing the messenger log, or false if none found
|
public
array
|
#
getMessengerList( integer $page = 1, array $order_by = ['date_sent' => 'DESC'], boolean $group_results = false )
Fetches a list of all messenger log entries
Fetches a list of all messenger log entries
Parameters
- $page
- The page to return results for (optional, default 1)
- $order_by
- The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)
- $group_results
True to group results by group, false to not
group at all (useful for page nav, optional, default false)
Returns
array An array of stdClass objects representing messenger logs
|
public
integer
|
#
getMessengerListCount( boolean $group_results = false )
Returns the total number of messenger log entries returned from Logs::getMessengerList(),
useful in constructing pagination for the getMessengerList() method.
Returns the total number of messenger log entries returned from Logs::getMessengerList(),
useful in constructing pagination for the getMessengerList() method.
Parameters
- $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 messengers logs
See
|
public
mixed
|
#
getMessengerGroupList( string $group )
Retrieves a list of all messenger log entries for a particular messenger group
Retrieves a list of all messenger log entries for a particular messenger group
Parameters
- $group
- The name of the group whose logs to retrieve
Returns
mixed An array of stdClass objects representing messenger logs for a particular group, false otherwise
|
public
integer
|
#
deleteMessengerToClient( integer $client_id )
Deletes all messenger logs sent to the given client
Deletes all messenger logs sent to the given client
Parameters
- $client_id
- The ID of the client to delete
Returns
integer The number of records deleted
|
public
integer
|
#
deleteMessengerLogs( string $datetime )
Deletes all of the messenger logs up until the date given for the current company
Deletes all of the messenger logs up until the date given for the current company
Parameters
- $datetime
- The datetime of the earliest log to keep. All older logs will be purged
Returns
integer The number of records deleted
|
public
integer
|
#
deleteService( integer $service_id )
Deletes all service logs for the given service
Deletes all service logs for the given service
Parameters
- $service_id
- The ID of the service whose logs to delete
Returns
integer The number of records deleted
|
public
integer
|
#
deleteServiceLogs( string $datetime )
Deletes all of the service logs up until the date given for the current company
Deletes all of the service logs up until the date given for the current company
Parameters
- $datetime
- The datetime of the earliest log to keep. All older logs will be purged
Returns
integer The number of records deleted
|
public
mixed
|
#
getUserLog( integer $user_id, string $type = 'any' )
Fetches the last log entry for the given user
Fetches the last log entry for the given user
Parameters
- $user_id
- The ID of the user
- $type
The specific log result to fetch (optional), one of:
- success The last successful log entry
- failure The last failure log entry
- any The last log entry (default)
Returns
mixed An stdClass object representing the user log entry, or false if none exist
|
public
mixed
|
#
getUserList( integer $page = 1, array $order_by = ['date_added' => 'DESC'] )
Fetches a list of all user log entries
Fetches a list of all user log entries
Parameters
- $page
- The page to return results for (optional, default 1)
- $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
|
public
array
|
#
searchUserLogs( array $filters, integer $page = 1 )
Gets a list of user logs filtered on the given criteria
Gets a list of user logs filtered on the given criteria
Parameters
- $filters
An array of filter criteria (optional)
- client_id The ID of the client
- $page
- The page to return results for (optional, default 1)
Returns
array A list of user logs
|
public
integer
|
#
deleteUser( integer $user_id )
Deletes all user logs for the given user
Deletes all user logs for the given user
Parameters
- $user_id
- The ID of the user whose logs to delete
Returns
integer The number of records deleted
|
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
- 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 = ['date_changed' => 'DESC'] )
Fetches a list of all contact log entries
Fetches a list of all contact log entries
Parameters
- $page
- The page to return results for (optional, default 1)
- $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
|
public
array
|
#
searchContactLogs( array $filters, integer $page = 1 )
Gets a list of contact logs filtered on the given criteria
Gets a list of contact logs filtered on the given criteria
Parameters
- $filters
An array of filter criteria (optional)
- client_id The ID of the client to filter on
- $page
- The page to return results for (optional, default 1)
Returns
array A list of contact logs
|
public
integer
|
#
deleteContact( integer $contact_id )
Deletes all logs by contact
Deletes all logs by contact
Parameters
- $contact_id
- The ID of the contact to delete
Returns
integer The number of records deleted
|
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
- 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 = ['date_changed' => 'DESC'] )
Fetches a list of all transaction log entries
Fetches a list of all transaction log entries
Parameters
- $page
- The page to return results for (optional, default 1)
- $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
|
public
integer
|
#
deleteTransaction( integer $transaction_id )
Deletes all transaction logs for the given transaction
Deletes all transaction logs for the given transaction
Parameters
- $transaction_id
- The ID of the transaction whose logs to delete
Returns
integer The number of records deleted
|
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
- 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 = ['date_accessed' => 'DESC'] )
Fetches a list of all account access log entries
Fetches a list of all account access log entries
Parameters
- $page
- The page to return results for (optional, default 1)
- $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
- The access log ID
Returns
An array of stdClass objects representing an account access log, or false if no log found
|
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
- The datetime of the earliest log to keep. All older logs will be purged
Returns
integer The number of records deleted
|
public
integer
|
#
addClientSetting( array $vars )
Logs client setting changes
Logs client setting changes
Parameters
- $vars
An array of client setting information including:
- client_id The ID of the client the log is for
- by_user_id The ID of the user that performed this action (optional, default null)
- ip_address The IP address of the user that performed this action (optional, default null)
- fields An array of fields where the key is the field that changed and it contains:
- prev The value of the field prior to the update
- cur The value of that field after the update
Returns
integer The client setting log ID for this record, void if error
|
public
mixed
|
#
getClientSettingsList( integer $page = 1, array $order_by = ['date_changed' => 'DESC'] )
Fetches a list of all client setting log entries
Fetches a list of all client setting log entries
Parameters
- $page
- The page to return results for (optional, default 1)
- $order_by
- The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)
Returns
mixed An array of stdClass objects representing client setting logs, or false if no logs found
|
public
integer
|
#
getClientSettingsListCount( )
Returns the total number of client setting log entries returned from Logs::getClientSettingsList(),
useful in constructing pagination for the getClientSettingsList() method.
Returns the total number of client setting log entries returned from Logs::getClientSettingsList(),
useful in constructing pagination for the getClientSettingsList() method.
Returns
integer The total number of client setting logs
See
|
public
integer
|
#
deleteClientSettingLogs( string $datetime, array $filters = [] )
Deletes all client settings that match the given filters for the current company
Deletes all client settings that match the given filters for the current company
Parameters
- $datetime
- The datetime of the earliest log to keep. All older logs will be purged
- $filters
An array of additional optional filter options, including:
- client_id The ID of the client whose log records to purge
Returns
integer The number of records deleted
|
public
mixed
|
#
getLatestCron( integer $cron_task_run_id, string $group = null )
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
- The cron task run ID
- $group
- The group the cron task is apart of (optional, default null)
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, string $task_type = 'plugin' )
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
- The cron task key
- $plugin_dir
- The directory this task belongs to (optional)
- $system
- True to fetch only system cron tasks, false to fetch company cron tasks (default false)
- $task_type
The type of cron task this is
(i.e. 'system', 'module', or 'plugin', default 'plugin' if $plugin_dir is set)
Returns
mixed An stdClass object representing the date this cron task
was last executed, or false if it has never run
|
public
mixed
|
#
getSystemCronLastRun( string $group = null )
Fetches the date at which the system cron has last been executed
Fetches the date at which the system cron has last been executed
Parameters
- $group
- The group the cron task is apart of (optional, default null)
Returns
mixed An stdClass object representing the system cron, or false if it has never run
|
public
|
#
clearCronTask( integer $cron_task_run_id, string $group = null )
Clears an incomplete cron task if it has not finished
Clears an incomplete cron task if it has not finished
Parameters
- $cron_task_run_id
- The cron task run ID
- $group
- The group the cron task is apart of (optional, default null)
|
public
array
|
#
getRunningCronTasks( integer $seconds = null )
Fetches a list of cron tasks that are currently running for this company
within the past 24 hours (i.e. started but not finished)
Fetches a list of cron tasks that are currently running for this company
within the past 24 hours (i.e. started but not finished)
Parameters
- $seconds
Filter on the number of seconds that have passed
since the task has started but not yet completed (optional, null to fetch all tasks currently running)
Returns
array A list of stdClass objects representing each cron task
|
public
mixed
|
#
getCronList( integer $page = 1, array $order_by = ['start_date' => 'DESC'] )
Fetches a list of all cron log entries
Fetches a list of all cron log entries
Parameters
- $page
- The page to return results for (optional, default 1)
- $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
|
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
- The datetime of the earliest log to keep. All older logs will be purged
Returns
integer The number of records deleted
|
public
boolean
|
#
validateDirection( string $direction )
Validates the 'direction' field for module and gateway logs
Validates the 'direction' field for module and gateway logs
Parameters
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
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
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
- 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
- The cron task group
- $cron_task_run_id
- The cron task run ID
- $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
- The user's ID to check
- $ip_address
- The IP address of the user
- $company_id
- The ID of the company
Returns
boolean True if the given information matches a user in the log, false otherwise
|