CRM_Logging_Differ
in package
Tags
Table of Contents
Properties
- $db : mixed
- $interval : mixed
- $log_conn_id : mixed
- $log_date : mixed
Methods
- __construct() : mixed
- Class constructor.
- checkLogCanBeUsedWithNoLogDate() : bool
- Check that the log record relates to a unique log id.
- diffsInTable() : array<string|int, mixed>
- diffsInTables() : array<string|int, mixed>
- getAllChangesForConnection() : array<string|int, mixed>
- Get all changes made in the connection.
- getCountOfAllContactChangesForConnection() : array<string|int, mixed>
- Get count of all changes made in the connection.
- titlesAndValuesForTable() : array<string|int, mixed>
- Get the titles & metadata option values for the table.
- diffsInTableForId() : array<string|int, mixed>
- filterInterval() : string
- Filter a MySQL interval expression.
- sqlToArray() : mixed
- titlesAndValuesForCustomDataTable() : array<string|int, mixed>
- Get the field titles & option group values for the custom table as at the reference date.
Properties
$db
private
mixed
$db
$interval
private
mixed
$interval
$log_conn_id
private
mixed
$log_conn_id
$log_date
private
mixed
$log_date
Methods
__construct()
Class constructor.
public
__construct(string $log_conn_id, string $log_date[, string $interval = '10 SECOND' ]) : mixed
Parameters
- $log_conn_id : string
- $log_date : string
- $interval : string = '10 SECOND'
checkLogCanBeUsedWithNoLogDate()
Check that the log record relates to a unique log id.
public
static checkLogCanBeUsedWithNoLogDate(string $change_date) : bool
If the record was recorded using the old non-unique style then the log_date MUST be set to get the (fairly accurate) list of changes. In this case the nasty 10 second interval rule is applied.
See CRM-18193 for a discussion of unique log id.
Parameters
- $change_date : string
Tags
Return values
booldiffsInTable()
public
diffsInTable(string $table[, int $contactID = NULL ]) : array<string|int, mixed>
Parameters
- $table : string
- $contactID : int = NULL
Return values
array<string|int, mixed>diffsInTables()
public
diffsInTables(mixed $tables) : array<string|int, mixed>
Parameters
- $tables : mixed
Return values
array<string|int, mixed>getAllChangesForConnection()
Get all changes made in the connection.
public
getAllChangesForConnection(array<string|int, mixed> $tables[, int $limit = 0 ][, int $offset = 0 ]) : array<string|int, mixed>
Parameters
- $tables : array<string|int, mixed>
-
Array of tables to inspect.
- $limit : int = 0
-
Limit result to x
- $offset : int = 0
-
Offset result to y
Return values
array<string|int, mixed>getCountOfAllContactChangesForConnection()
Get count of all changes made in the connection.
public
getCountOfAllContactChangesForConnection(array<string|int, mixed> $tables) : array<string|int, mixed>
Parameters
- $tables : array<string|int, mixed>
-
Array of tables to inspect.
Return values
array<string|int, mixed>titlesAndValuesForTable()
Get the titles & metadata option values for the table.
public
titlesAndValuesForTable(string $table, string $referenceDate) : array<string|int, mixed>
For custom fields the titles may change so we use the ones as at the reference date.
Parameters
- $table : string
- $referenceDate : string
Return values
array<string|int, mixed>diffsInTableForId()
private
diffsInTableForId(mixed $table, int $id) : array<string|int, mixed>
Parameters
- $table : mixed
- $id : int
Tags
Return values
array<string|int, mixed>filterInterval()
Filter a MySQL interval expression.
private
static filterInterval(string $interval) : string
Parameters
- $interval : string
Tags
Return values
string —Normalized version of $interval
sqlToArray()
private
sqlToArray(mixed $sql, array<string|int, mixed> $params) : mixed
Parameters
- $sql : mixed
- $params : array<string|int, mixed>
titlesAndValuesForCustomDataTable()
Get the field titles & option group values for the custom table as at the reference date.
private
titlesAndValuesForCustomDataTable(string $table, string $referenceDate) : array<string|int, mixed>
Parameters
- $table : string
- $referenceDate : string