Blesta Source Documentation

Logs extends AppModel

Log System

Table of Contents

Methods

__construct() Initialize Logs
addAccountAccess() Logs access to customer payment account details
addClientSetting() Logs client setting changes
addContact() Logs a change to contact information
addCron() Logs cron task details
addEmail() Logs a single email
addGateway() Logs a gateway requests
addMessenger() Logs a messenger request
addModule() Logs a module request
addServiceChange() Logs a service change
addTransaction() Logs a change to transaction information
addUser() Logs a user log in
clearCronTask() Clears an incomplete cron task if it has not finished
deleteAccountAccessLogs() Deletes all of the account access logs up until the date given for the current company
deleteClientSettingLogs() Deletes all client settings that match the given filters for the current company
deleteContact() Deletes all logs by contact
deleteContactLogs() Deletes all of the contact logs up until the date given for the current company
deleteCronLogs() Deletes all of the cron logs up until the date given for the current company
deleteEmailLogs() Deletes all of the email logs up until the date given for the current company
deleteEmailToClient() Deletes all email logs sent to the given client
deleteGatewayLogs() Deletes all of the gateway logs up until the date given for the current company
deleteMessengerLogs() Deletes all of the messenger logs up until the date given for the current company
deleteMessengerToClient() Deletes all messenger logs sent to the given client
deleteModuleLogs() Deletes all of the module logs up until the date given for the current company
deleteService() Deletes all service logs for the given service
deleteServiceChangesLogs() Deletes all of the service changes logs up until the date given for the current company
deleteServiceLogs() Deletes all of the service logs up until the date given for the current company
deleteTransaction() Deletes all transaction logs for the given transaction
deleteTransactionLogs() Deletes all of the transaction logs up until the date given for the current company
deleteUser() Deletes all user logs for the given user
deleteUserLogs() Deletes all of the users logs up until the date given for the current company
getAccountAccessList() Fetches a list of all account access log entries
getAccountAccessListCount() Returns the total number of contact log entries returned from Logs::getAccountAccessList(), useful in constructing pagination for the getAccountAccessList() method.
getAccountAccessLog() Fetches account data that was accessed
getClientSettingsList() Fetches a list of all client setting log entries
getClientSettingsListCount() Returns the total number of client setting log entries returned from Logs::getClientSettingsList(), useful in constructing pagination for the getClientSettingsList() method.
getContactList() Fetches a list of all contact log entries
getContactListCount() Returns the total number of contact log entries returned from Logs::getContactList(), useful in constructing pagination for the getContactList() method.
getCronLastExecution() Returns the last x executions of the cron job (where x is the $limit parameter)
getCronLastRun() Fetches the date at which the given cron task has last been executed
getCronList() Fetches a list of all cron log entries
getCronListCount() Returns the total number of cron log entries returned from Logs::getCronList(), useful in constructing pagination for the getCronList() method.
getEmail() Fetches a single email log
getEmailList() Fetches a list of all email log entries
getEmailListCount() Returns the total number of email log entries returned from Logs::getEmailList(), useful in constructing pagination for the getEmailList() method.
getGatewayGroupList() Retrieves a list of all gateway log entries for a particular gateway group
getGatewayList() Fetches a list of all gateway log entries
getGatewayListCount() Returns the total number of gateway log entries returned from Logs::getGatewayList(), useful in constructing pagination for the getGatewayList() method.
getLatestCron() Fetches the latest cron log for the given run task belonging to this company
getMessenger() Fetches a single messenger log
getMessengerGroupList() Retrieves a list of all messenger log entries for a particular messenger group
getMessengerList() Fetches a list of all messenger log entries
getMessengerListCount() Returns the total number of messenger log entries returned from Logs::getMessengerList(), useful in constructing pagination for the getMessengerList() method.
getModuleGroupList() Retrieves a list of all module log entries for a particular module group
getModuleList() Fetches a list of all module log entries
getModuleListCount() Returns the total number of module log entries returned from Logs::getModuleList(), useful in constructing pagination for the getModuleList() method.
getRunningCronTasks() Fetches a list of cron tasks that are currently running for this company within the past 24 hours (i.e. started but not finished)
getServiceChangeList() Fetches a list of all service changes log entries
getServiceChangeListCount()
getSystemCronLastRun() Fetches the date at which the system cron has last been executed
getTransactionList() Fetches a list of all transaction log entries
getTransactionListCount() Returns the total number of transaction log entries returned from Logs::getTransactionLogs(), useful in constructing pagination for the getTransactionList() method.
getUserList() Fetches a list of all user log entries
getUserListCount() Returns the total number of user log entries returned from Logs::getUserList(), useful in constructing pagination for the getUserList() method.
getUserLog() Fetches the last log entry for the given user
searchContactLogs() Gets a list of contact logs filtered on the given criteria
searchUserLogs() Gets a list of user logs filtered on the given criteria
updateCron() Updates the cron log for a particular logged task
updateUser() Updates the user log for a user
validateCronExists() Validates that the given cron task run ID exists
validateCronLogUnique() Checks whether the given cron task ID and group are unique
validateDirection() Validates the 'direction' field for module and gateway logs
validateStatus() Validates the 'status' field for module and gateway logs
validateType() Validates the 'type' field for the account access logs
validateUserLogExists() Checks whether the given information corresponds to a valid user log entry
getAccountAccessLogs() Partially constructs the query required by Logs::getAccountAccessLogs(), and Logs::getAccountAccessListCount()
getClientSettingsLogs() Partially constructs the query required by Logs::getClientSettingsLogs(), Logs::getClientSettingsListCount()
getContactLogs() Partially constructs the query required by Logs::getContactLogs(), Logs::getContactListCount(), and Logs::searchContactLogs()
getCronLogs() Partially constructs the query required by Logs::getCronLogs(), and Logs::getCronListCount()
getDeleteLogRules() Retrieves a list of log rules for deletion
getEmailLogs() Partially constructs the query required by Logs::getEmailList(), and Logs::getEmailListCount()
getGatewayLogs() Partially constructs the query required by Logs::getGatewayList(), and Logs::getGatewayListCount()
getMessengerLogs() Partially constructs the query required by Logs::getMessengerList(), and Logs::getMessengerListCount()
getModuleLogs() Partially constructs the query required by Logs::getModuleList(), and Logs::getModuleListCount()
getServiceChangeLogs() Partially constructs the query required by Logs::getServiceChangeList(), and Logs::getServiceChangeListCount()
getTransactionLogs() Partially constructs the query required by Logs::getTransactionLogs(), and Logs::getTransactionListCount()
getUserLogs() Partially constructs the query required by Logs::getUserList(), Logs::getUserListCount(), and Logs::searchUserLogs()
Methods

__construct()

Initialize Logs

public __construct() : mixed

addAccountAccess()

Logs access to customer payment account details

public addAccountAccess(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

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)
Tags
see
AppModel::systemEncrypt()
Return values
int

The account access log ID for this record, void if error

addClientSetting()

Logs client setting changes

public addClientSetting(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

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
Return values
int

The client setting log ID for this record, void if error

addContact()

Logs a change to contact information

public addContact(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

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
Return values
int

The contact log ID for this record, void if error

addCron()

Logs cron task details

public addCron(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

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)
  • key The key of the cron task (optional)
Return values
int

The cron log ID, or void on error

addEmail()

Logs a single email

public addEmail(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

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
Return values
int

The email log ID for this record, void if error

addGateway()

Logs a gateway requests

public addGateway(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

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
Return values
int

The gateway log ID for this record, void if error

addMessenger()

Logs a messenger request

public addMessenger(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

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
Return values
int

The messenger log ID for this record, void if error

addModule()

Logs a module request

public addModule(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

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
Return values
int

The module log ID for this record, void if error

addServiceChange()

Logs a service change

public addServiceChange(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>
  • service_id The ID of the service
  • transaction_id The ID of the transaction associated with the service change (optional)
  • old_service The old service fields
  • new_service The new service fields
Return values
int

The service change log ID for this record, void if error

addTransaction()

Logs a change to transaction information

public addTransaction(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

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
Return values
int

The transaction log ID for this record, void if error

addUser()

Logs a user log in

public addUser(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

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
Return values
int

The user log ID for this record, void if error

clearCronTask()

Clears an incomplete cron task if it has not finished

public clearCronTask(int $cron_task_run_id[, string $group = null ]) : mixed
Parameters
$cron_task_run_id : int

The cron task run ID

$group : string = null

The group the cron task is apart of (optional, default null)

deleteAccountAccessLogs()

Deletes all of the account access logs up until the date given for the current company

public deleteAccountAccessLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

deleteClientSettingLogs()

Deletes all client settings that match the given filters for the current company

public deleteClientSettingLogs(string $datetime[, array<string|int, mixed> $filters = [] ]) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

$filters : array<string|int, mixed> = []

An array of additional optional filter options, including:

  • client_id The ID of the client whose log records to purge
Return values
int

The number of records deleted

deleteContact()

Deletes all logs by contact

public deleteContact(int $contact_id) : int
Parameters
$contact_id : int

The ID of the contact to delete

Return values
int

The number of records deleted

deleteContactLogs()

Deletes all of the contact logs up until the date given for the current company

public deleteContactLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

deleteCronLogs()

Deletes all of the cron logs up until the date given for the current company

public deleteCronLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

deleteEmailLogs()

Deletes all of the email logs up until the date given for the current company

public deleteEmailLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

deleteEmailToClient()

Deletes all email logs sent to the given client

public deleteEmailToClient(int $client_id) : int
Parameters
$client_id : int

The ID of the client to delete

Return values
int

The number of records deleted

deleteGatewayLogs()

Deletes all of the gateway logs up until the date given for the current company

public deleteGatewayLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

deleteMessengerLogs()

Deletes all of the messenger logs up until the date given for the current company

public deleteMessengerLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

deleteMessengerToClient()

Deletes all messenger logs sent to the given client

public deleteMessengerToClient(int $client_id) : int
Parameters
$client_id : int

The ID of the client to delete

Return values
int

The number of records deleted

deleteModuleLogs()

Deletes all of the module logs up until the date given for the current company

public deleteModuleLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

deleteService()

Deletes all service logs for the given service

public deleteService(int $service_id) : int
Parameters
$service_id : int

The ID of the service whose logs to delete

Return values
int

The number of records deleted

deleteServiceChangesLogs()

Deletes all of the service changes logs up until the date given for the current company

public deleteServiceChangesLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

deleteServiceLogs()

Deletes all of the service logs up until the date given for the current company

public deleteServiceLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

deleteTransaction()

Deletes all transaction logs for the given transaction

public deleteTransaction(int $transaction_id) : int
Parameters
$transaction_id : int

The ID of the transaction whose logs to delete

Return values
int

The number of records deleted

deleteTransactionLogs()

Deletes all of the transaction logs up until the date given for the current company

public deleteTransactionLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

deleteUser()

Deletes all user logs for the given user

public deleteUser(int $user_id) : int
Parameters
$user_id : int

The ID of the user whose logs to delete

Return values
int

The number of records deleted

deleteUserLogs()

Deletes all of the users logs up until the date given for the current company

public deleteUserLogs(string $datetime) : int
Parameters
$datetime : string

The datetime of the earliest log to keep. All older logs will be purged

Return values
int

The number of records deleted

getAccountAccessList()

Fetches a list of all account access log entries

public getAccountAccessList([int $page = 1 ][, string $order_by = ['date_accessed' => 'DESC'] ][, array<string|int, mixed> $filters = [] ]) : mixed
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : string = ['date_accessed' => 'DESC']

The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
mixed

An array of stdClass objects representing account access logs, or false if no logs found

getAccountAccessListCount()

Returns the total number of contact log entries returned from Logs::getAccountAccessList(), useful in constructing pagination for the getAccountAccessList() method.

public getAccountAccessListCount([array<string|int, mixed> $filters = [] ]) : int
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Tags
see
Logs::getAccountAccessList()
Return values
int

The total number of account access logs

getAccountAccessLog()

Fetches account data that was accessed

public getAccountAccessLog(int $log_id) : An
Parameters
$log_id : int

The access log ID

Return values
An

array of stdClass objects representing an account access log, or false if no log found

getClientSettingsList()

Fetches a list of all client setting log entries

public getClientSettingsList([int $page = 1 ][, string $order_by = ['date_changed' => 'DESC'] ][, array<string|int, mixed> $filters = [] ]) : mixed
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : string = ['date_changed' => 'DESC']

The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
mixed

An array of stdClass objects representing client setting logs, or false if no logs found

getClientSettingsListCount()

Returns the total number of client setting log entries returned from Logs::getClientSettingsList(), useful in constructing pagination for the getClientSettingsList() method.

public getClientSettingsListCount([array<string|int, mixed> $filters = [] ]) : int
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Tags
see
Logs::getClientSettingsList()
Return values
int

The total number of client setting logs

getContactList()

Fetches a list of all contact log entries

public getContactList([int $page = 1 ][, string $order_by = ['date_changed' => 'DESC'] ][, array<string|int, mixed> $filters = [] ]) : mixed
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : string = ['date_changed' => 'DESC']

The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
mixed

An array of stdClass objects representing contact logs, or false if no logs found

getContactListCount()

Returns the total number of contact log entries returned from Logs::getContactList(), useful in constructing pagination for the getContactList() method.

public getContactListCount([array<string|int, mixed> $filters = [] ]) : int
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Tags
see
Logs::getContactList()
Return values
int

The total number of contact logs

getCronLastExecution()

Returns the last x executions of the cron job (where x is the $limit parameter)

public getCronLastExecution([int $limit = 1 ][, string $key = 'cron_index' ]) : array<string|int, mixed>
Parameters
$limit : int = 1

The limit of executions to fetch, 1 by default

$key : string = 'cron_index'

The key of the task to fetch the last execution, cron_index by default

Return values
array<string|int, mixed>

An array of classes representing the cron executions

getCronLastRun()

Fetches the date at which the given cron task has last been executed

public getCronLastRun(int $cron_task_key[, string $plugin_dir = null ][, bool $system = false ][, string $task_type = 'plugin' ]) : mixed
Parameters
$cron_task_key : int

The cron task key

$plugin_dir : string = null

The directory this task belongs to (optional)

$system : bool = false

True to fetch only system cron tasks, false to fetch company cron tasks (default false)

$task_type : string = 'plugin'

The type of cron task this is (i.e. 'system', 'module', or 'plugin', default 'plugin' if $plugin_dir is set)

Return values
mixed

An stdClass object representing the date this cron task was last executed, or false if it has never run

getCronList()

Fetches a list of all cron log entries

public getCronList([int $page = 1 ][, string $order_by = ['start_date' => 'DESC'] ][, array<string|int, mixed> $filters = [] ]) : mixed
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : string = ['start_date' => 'DESC']

The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
mixed

An array of stdClass objects representing user logs, or false if no logs found

getCronListCount()

Returns the total number of cron log entries returned from Logs::getCronList(), useful in constructing pagination for the getCronList() method.

public getCronListCount([array<string|int, mixed> $filters = [] ]) : int
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Tags
see
Logs::getCronList()
Return values
int

The total number of cron logs

getEmail()

Fetches a single email log

public getEmail(int $email_log_id) : mixed
Parameters
$email_log_id : int

The email log ID of the email to get

Return values
mixed

An stdClass representing the email log, or false if none found

getEmailList()

Fetches a list of all email log entries

public getEmailList([int $page = 1 ][, string $order_by = ['date_sent' => 'DESC'] ][, array<string|int, mixed> $filters = [] ]) : array<string|int, mixed>
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : string = ['date_sent' => 'DESC']

The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
array<string|int, mixed>

An array of stdClass objects representing email logs

getEmailListCount()

Returns the total number of email log entries returned from Logs::getEmailList(), useful in constructing pagination for the getEmailList() method.

public getEmailListCount([array<string|int, mixed> $filters = [] ]) : int
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Tags
see
Logs::getEmailList()
Return values
int

The total number of email logs

getGatewayGroupList()

Retrieves a list of all gateway log entries for a particular gateway group

public getGatewayGroupList(string $group) : mixed
Parameters
$group : string

The name of the group whose logs to retrieve

Return values
mixed

An array of stdClass objects representing gateway logs for a particular group, false otherwise

getGatewayList()

Fetches a list of all gateway log entries

public getGatewayList([int $page = 1 ][, string $order_by = ['date_added' => 'DESC'] ][, bool $group_results = false ][, array<string|int, mixed> $filters = [] ]) : mixed
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : string = ['date_added' => 'DESC']

The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

$group_results : bool = false

True to group results by group, false to not group at all (useful for page nav, optional, default false)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
mixed

An array of stdClass objects representing gateway logs, or false if no logs found

getGatewayListCount()

Returns the total number of gateway log entries returned from Logs::getGatewayList(), useful in constructing pagination for the getGatewayList() method.

public getGatewayListCount([bool $group_results = false ][, array<string|int, mixed> $filters = [] ]) : int
Parameters
$group_results : bool = false

True to group results by group, false to not group at all (useful for page nav, optional, default false)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Tags
see
Logs::getGatewayList()
Return values
int

The total number of gateway logs

getLatestCron()

Fetches the latest cron log for the given run task belonging to this company

public getLatestCron(int $cron_task_run_id[, string $group = null ]) : mixed
Parameters
$cron_task_run_id : int

The cron task run ID

$group : string = null

The group the cron task is apart of (optional, default null)

Return values
mixed

An stdClass object representing the cron log for this task, or false if none exist

getMessenger()

Fetches a single messenger log

public getMessenger(int $messenger_log_id) : mixed
Parameters
$messenger_log_id : int

The messenger log ID of the messenger to get

Return values
mixed

An stdClass representing the messenger log, or false if none found

getMessengerGroupList()

Retrieves a list of all messenger log entries for a particular messenger group

public getMessengerGroupList(string $group) : mixed
Parameters
$group : string

The name of the group whose logs to retrieve

Return values
mixed

An array of stdClass objects representing messenger logs for a particular group, false otherwise

getMessengerList()

Fetches a list of all messenger log entries

public getMessengerList([int $page = 1 ][, array<string|int, mixed> $order_by = ['date_sent' => 'DESC'] ][, bool $group_results = false ][, array<string|int, mixed> $filters = [] ]) : array<string|int, mixed>
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : array<string|int, mixed> = ['date_sent' => 'DESC']

The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

$group_results : bool = false

True to group results by group, false to not group at all (useful for page nav, optional, default false)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
array<string|int, mixed>

An array of stdClass objects representing messenger logs

getMessengerListCount()

Returns the total number of messenger log entries returned from Logs::getMessengerList(), useful in constructing pagination for the getMessengerList() method.

public getMessengerListCount([bool $group_results = false ][, array<string|int, mixed> $filters = [] ]) : int
Parameters
$group_results : bool = false

True to group results by group, false to not group at all (useful for page nav, optional, default false)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Tags
see
Logs::getMessengerList()
Return values
int

The total number of messengers logs

getModuleGroupList()

Retrieves a list of all module log entries for a particular module group

public getModuleGroupList(string $group) : mixed
Parameters
$group : string

The name of the group whose logs to retrieve

Return values
mixed

An array of stdClass objects representing module logs for a particular group, false otherwise

getModuleList()

Fetches a list of all module log entries

public getModuleList([int $page = 1 ][, string $order_by = ['date_added' => 'DESC'] ][, bool $group_results = false ][, array<string|int, mixed> $filters = [] ]) : mixed
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : string = ['date_added' => 'DESC']

The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

$group_results : bool = false

True to group results by group, false to not group at all (useful for page nav, optional, default false)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
mixed

An array of stdClass objects representing module logs, or false if no logs found

getModuleListCount()

Returns the total number of module log entries returned from Logs::getModuleList(), useful in constructing pagination for the getModuleList() method.

public getModuleListCount([bool $group_results = false ][, array<string|int, mixed> $filters = [] ]) : int
Parameters
$group_results : bool = false

True to group results by group, false to not group at all (useful for page nav, optional, default false)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Tags
see
Logs::getModuleList()
Return values
int

The total number of module logs

getRunningCronTasks()

Fetches a list of cron tasks that are currently running for this company within the past 24 hours (i.e. started but not finished)

public getRunningCronTasks([int $seconds = null ]) : array<string|int, mixed>
Parameters
$seconds : int = null

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)

Return values
array<string|int, mixed>

A list of stdClass objects representing each cron task

getServiceChangeList()

Fetches a list of all service changes log entries

public getServiceChangeList([int $page = 1 ][, array<string|int, mixed> $order_by = ['date_changed' => 'DESC'] ][, array<string|int, mixed> $filters = [] ]) : mixed
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : array<string|int, mixed> = ['date_changed' => 'DESC']

The sort and order conditions (e.g. array('date_changed'=>"DESC"), optional)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
mixed

An array of stdClass objects representing gateway logs, or false if no logs found

getServiceChangeListCount()

public getServiceChangeListCount([array<string|int, mixed> $filters = [] ]) : int
Parameters
$filters : array<string|int, mixed> = []
Return values
int

getSystemCronLastRun()

Fetches the date at which the system cron has last been executed

public getSystemCronLastRun([string $group = null ]) : mixed
Parameters
$group : string = null

The group the cron task is apart of (optional, default null)

Return values
mixed

An stdClass object representing the system cron, or false if it has never run

getTransactionList()

Fetches a list of all transaction log entries

public getTransactionList([int $page = 1 ][, string $order_by = ['date_changed' => 'DESC'] ][, array<string|int, mixed> $filters = [] ]) : array<string|int, mixed>
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : string = ['date_changed' => 'DESC']

The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
array<string|int, mixed>

An array of stdClass objects representing transaction logs

getTransactionListCount()

Returns the total number of transaction log entries returned from Logs::getTransactionLogs(), useful in constructing pagination for the getTransactionList() method.

public getTransactionListCount([array<string|int, mixed> $filters = [] ]) : int
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Tags
see
Logs::getTransactionList()
Return values
int

The total number of transaction logs

getUserList()

Fetches a list of all user log entries

public getUserList([int $page = 1 ][, string $order_by = ['date_added' => 'DESC'] ][, array<string|int, mixed> $filters = [] ]) : mixed
Parameters
$page : int = 1

The page to return results for (optional, default 1)

$order_by : string = ['date_added' => 'DESC']

The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
mixed

An array of stdClass objects representing user logs, or false if no logs found

getUserListCount()

Returns the total number of user log entries returned from Logs::getUserList(), useful in constructing pagination for the getUserList() method.

public getUserListCount([array<string|int, mixed> $filters = [] ]) : int
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Tags
see
Logs::getUserList()
Return values
int

The total number of user logs

getUserLog()

Fetches the last log entry for the given user

public getUserLog(int $user_id[, string $type = 'any' ]) : mixed
Parameters
$user_id : int

The ID of the user

$type : string = 'any'

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)
Return values
mixed

An stdClass object representing the user log entry, or false if none exist

searchContactLogs()

Gets a list of contact logs filtered on the given criteria

public searchContactLogs(array<string|int, mixed> $filters[, int $page = 1 ]) : array<string|int, mixed>
Parameters
$filters : array<string|int, mixed>

An array of filter criteria (optional)

  • client_id The ID of the client to filter on
$page : int = 1

The page to return results for (optional, default 1)

Return values
array<string|int, mixed>

A list of contact logs

searchUserLogs()

Gets a list of user logs filtered on the given criteria

public searchUserLogs(array<string|int, mixed> $filters[, int $page = 1 ]) : array<string|int, mixed>
Parameters
$filters : array<string|int, mixed>

An array of filter criteria (optional)

  • client_id The ID of the client
$page : int = 1

The page to return results for (optional, default 1)

Return values
array<string|int, mixed>

A list of user logs

updateCron()

Updates the cron log for a particular logged task

public updateCron(int $cron_task_run_id, string $group[, string $event = '' ][, array<string|int, mixed> $vars = [] ]) : mixed
Parameters
$cron_task_run_id : int

The cron task run ID of the logged task

$group : string

The group of the logged task

$event : string = ''

The cron log event (optional, default "")

$vars : array<string|int, mixed> = []

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)

updateUser()

Updates the user log for a user

public updateUser(int $user_id, string $ip_address, int $company_id) : mixed
Parameters
$user_id : int

The user's ID

$ip_address : string

The user's IP address

$company_id : int

The company ID

validateCronExists()

Validates that the given cron task run ID exists

public validateCronExists(int $cron_task_run_id) : bool
Parameters
$cron_task_run_id : int

The cron task run ID

Return values
bool

True if the cron task run ID exists, false otherwise

validateCronLogUnique()

Checks whether the given cron task ID and group are unique

public validateCronLogUnique(string $group, int $cron_task_run_id, string $event) : bool
Parameters
$group : string

The cron task group

$cron_task_run_id : int

The cron task run ID

$event : string

The cron event

Return values
bool

True if the given cron task run ID, group, and event are unique, false otherwise

validateDirection()

Validates the 'direction' field for module and gateway logs

public validateDirection(string $direction) : bool
Parameters
$direction : string

The direction

Return values
bool

True if direction is validated, false otherwise

validateStatus()

Validates the 'status' field for module and gateway logs

public validateStatus(string $status) : bool
Parameters
$status : string

The status

Return values
bool

True if status is validated, false otherwise

validateType()

Validates the 'type' field for the account access logs

public validateType(string $type) : bool
Parameters
$type : string

The type

Return values
bool

True if type is validated, false otherwise

validateUserLogExists()

Checks whether the given information corresponds to a valid user log entry

public validateUserLogExists(int $user_id, string $ip_address, int $company_id) : bool
Parameters
$user_id : int

The user's ID to check

$ip_address : string

The IP address of the user

$company_id : int

The ID of the company

Return values
bool

True if the given information matches a user in the log, false otherwise

getAccountAccessLogs()

Partially constructs the query required by Logs::getAccountAccessLogs(), and Logs::getAccountAccessListCount()

private getAccountAccessLogs([array<string|int, mixed> $filters = [] ]) : Record
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
Record

The partially constructed query Record object

getClientSettingsLogs()

Partially constructs the query required by Logs::getClientSettingsLogs(), Logs::getClientSettingsListCount()

private getClientSettingsLogs([array<string|int, mixed> $filters = [] ]) : Record
Parameters
$filters : array<string|int, mixed> = []

An array of filter criteria (optional)

  • client_id The ID of the client to filter on
Return values
Record

The partially constructed query Record object

getContactLogs()

Partially constructs the query required by Logs::getContactLogs(), Logs::getContactListCount(), and Logs::searchContactLogs()

private getContactLogs([array<string|int, mixed> $filters = [] ]) : Record
Parameters
$filters : array<string|int, mixed> = []

An array of filter criteria (optional)

  • client_id The ID of the client to filter on
Return values
Record

The partially constructed query Record object

getCronLogs()

Partially constructs the query required by Logs::getCronLogs(), and Logs::getCronListCount()

private getCronLogs([array<string|int, mixed> $filters = [] ]) : Record
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
Record

The partially constructed query Record object

getDeleteLogRules()

Retrieves a list of log rules for deletion

private getDeleteLogRules() : array<string|int, mixed>
Return values
array<string|int, mixed>

A list of log deletion rules

getEmailLogs()

Partially constructs the query required by Logs::getEmailList(), and Logs::getEmailListCount()

private getEmailLogs([array<string|int, mixed> $filters = [] ]) : Record
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
Record

The partially constructed query Record object

getGatewayLogs()

Partially constructs the query required by Logs::getGatewayList(), and Logs::getGatewayListCount()

private getGatewayLogs([string $group = null ][, bool $group_results = false ][, array<string|int, mixed> $filters = [] ]) : Record
Parameters
$group : string = null

The name of the group whose logs to retrieve (optional, default null for all)

$group_results : bool = false

True to group results by group, false to not group at all (useful for page nav, optional, default false)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
Record

The partially constructed query Record object

getMessengerLogs()

Partially constructs the query required by Logs::getMessengerList(), and Logs::getMessengerListCount()

private getMessengerLogs([string $group = null ][, bool $group_results = false ][, array<string|int, mixed> $filters = [] ]) : Record
Parameters
$group : string = null

The name of the group whose logs to retrieve (optional, default null for all)

$group_results : bool = false

True to group results by group, false to not group at all (useful for page nav, optional, default false)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
Record

The partially constructed query Record object

getModuleLogs()

Partially constructs the query required by Logs::getModuleList(), and Logs::getModuleListCount()

private getModuleLogs([string $group = null ][, bool $group_results = false ][, array<string|int, mixed> $filters = [] ]) : Record
Parameters
$group : string = null

The name of the group whose logs to retrieve (optional, default null for all)

$group_results : bool = false

True to group results by group, false to not group at all (useful for page nav, optional, default false)

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
Record

The partially constructed query Record object

getServiceChangeLogs()

Partially constructs the query required by Logs::getServiceChangeList(), and Logs::getServiceChangeListCount()

private getServiceChangeLogs([array<string|int, mixed> $filters = [] ]) : Record
Parameters
$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • string The (partial) string on which to filter logs
  • start_date The start date on which to filter logs
  • end_date The end date on which to filter logs
Return values
Record

The partially constructed query Record object

getTransactionLogs()

Partially constructs the query required by Logs::getTransactionLogs(), and Logs::getTransactionListCount()

private getTransactionLogs([array<string|int, mixed> $filters = [] ]) : Record
Parameters
$filters : array<string|int, mixed> = []
Return values
Record

The partially constructed query Record object

getUserLogs()

Partially constructs the query required by Logs::getUserList(), Logs::getUserListCount(), and Logs::searchUserLogs()

private getUserLogs([array<string|int, mixed> $filters = [] ]) : Record
Parameters
$filters : array<string|int, mixed> = []

An array of filter criteria (optional)

  • client_id The ID of the client
Return values
Record

The partially constructed query Record object

Tags
subpackage

app.models

copyright

Copyright (c) 2010, Phillips Data, Inc.

license

http://www.blesta.com/license/ The Blesta License Agreement

link

Blesta


        
On this page

Search results