$rows = array();
$tempColumns = "id int(10)";
- if (CRM_Utils_Array::value('log_action', $this->_params['fields'])) {
+ if (!empty($this->_params['fields']['log_action'])) {
$tempColumns .= ", log_action varchar(64)";
}
$tempColumns .= ", log_type varchar(64), log_user_id int(10), log_date timestamp";
- if (CRM_Utils_Array::value('altered_contact', $this->_params['fields'])) {
+ if (!empty($this->_params['fields']['altered_contact'])) {
$tempColumns .= ", altered_contact varchar(128)";
}
$tempColumns .= ", altered_contact_id int(10), log_conn_id int(11), is_deleted tinyint(4)";
- if (CRM_Utils_Array::value('display_name', $this->_params['fields'])) {
+ if (!empty($this->_params['fields']['display_name'])) {
$tempColumns .= ", display_name varchar(128)";
}
}
function getLogType($entity) {
- if (CRM_Utils_Array::value('log_type', $this->_logTables[$entity])) {
+ if (!empty($this->_logTables[$entity]['log_type'])) {
return $this->_logTables[$entity]['log_type'];
}
$logType = ucfirst(substr($entity, strrpos($entity, '_') + 1));
}
function getEntityValue($id, $entity, $logDate) {
- if (CRM_Utils_Array::value('bracket_info', $this->_logTables[$entity])) {
- if (CRM_Utils_Array::value('entity_column', $this->_logTables[$entity]['bracket_info'])) {
- $logTable = CRM_Utils_Array::value('table_name', $this->_logTables[$entity]) ? $this->_logTables[$entity]['table_name'] : $entity;
+ if (!empty($this->_logTables[$entity]['bracket_info'])) {
+ if (!empty($this->_logTables[$entity]['bracket_info']['entity_column'])) {
+ $logTable = !empty($this->_logTables[$entity]['table_name']) ? $this->_logTables[$entity]['table_name'] : $entity;
$sql = "
SELECT {$this->_logTables[$entity]['bracket_info']['entity_column']}
FROM `{$this->loggingDB}`.{$logTable}
}
function getEntityAction($id, $connId, $entity, $oldAction) {
- if (CRM_Utils_Array::value('action_column', $this->_logTables[$entity])) {
+ if (!empty($this->_logTables[$entity]['action_column'])) {
$sql = "select {$this->_logTables[$entity]['action_column']} from `{$this->loggingDB}`.{$entity} where id = %1 AND log_conn_id = %2";
$newAction = CRM_Core_DAO::singleValueQuery($sql, array(
1 => array($id, 'Integer'),