5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/SystemLog.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:edcf9c070365c92afa56f7f3fe79acee)
13 * Database access object for the SystemLog entity.
15 class CRM_Core_DAO_SystemLog
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_system_log';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 * Standardized message
53 * error level per PSR3
60 * Timestamp of when event occurred.
67 * Optional Contact ID that created the log. Not an FK as we keep this regardless
74 * Optional Name of logging host
83 public function __construct() {
84 $this->__table
= 'civicrm_system_log';
85 parent
::__construct();
89 * Returns all the column names of this table
93 public static function &fields() {
94 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
95 Civi
::$statics[__CLASS__
]['fields'] = [
98 'type' => CRM_Utils_Type
::T_INT
,
99 'title' => ts('System Log ID'),
100 'description' => ts('Primary key ID'),
102 'table_name' => 'civicrm_system_log',
103 'entity' => 'SystemLog',
104 'bao' => 'CRM_Core_DAO_SystemLog',
109 'type' => CRM_Utils_Type
::T_STRING
,
110 'title' => ts('System Log Message'),
111 'description' => ts('Standardized message'),
114 'size' => CRM_Utils_Type
::HUGE
,
115 'table_name' => 'civicrm_system_log',
116 'entity' => 'SystemLog',
117 'bao' => 'CRM_Core_DAO_SystemLog',
122 'type' => CRM_Utils_Type
::T_LONGTEXT
,
123 'title' => ts('Detailed Log Data'),
124 'description' => ts('JSON encoded data'),
125 'table_name' => 'civicrm_system_log',
126 'entity' => 'SystemLog',
127 'bao' => 'CRM_Core_DAO_SystemLog',
132 'type' => CRM_Utils_Type
::T_STRING
,
133 'title' => ts('Detailed Log Data'),
134 'description' => ts('error level per PSR3'),
136 'size' => CRM_Utils_Type
::TWELVE
,
138 'table_name' => 'civicrm_system_log',
139 'entity' => 'SystemLog',
140 'bao' => 'CRM_Core_DAO_SystemLog',
144 'name' => 'timestamp',
145 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
146 'title' => ts('Log Timestamp'),
147 'description' => ts('Timestamp of when event occurred.'),
148 'default' => 'CURRENT_TIMESTAMP',
149 'table_name' => 'civicrm_system_log',
150 'entity' => 'SystemLog',
151 'bao' => 'CRM_Core_DAO_SystemLog',
155 'name' => 'contact_id',
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Log Contact ID'),
158 'description' => ts('Optional Contact ID that created the log. Not an FK as we keep this regardless'),
159 'table_name' => 'civicrm_system_log',
160 'entity' => 'SystemLog',
161 'bao' => 'CRM_Core_DAO_SystemLog',
165 'name' => 'hostname',
166 'type' => CRM_Utils_Type
::T_STRING
,
167 'title' => ts('Log Host'),
168 'description' => ts('Optional Name of logging host'),
170 'size' => CRM_Utils_Type
::HUGE
,
171 'table_name' => 'civicrm_system_log',
172 'entity' => 'SystemLog',
173 'bao' => 'CRM_Core_DAO_SystemLog',
177 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
179 return Civi
::$statics[__CLASS__
]['fields'];
183 * Return a mapping from field-name to the corresponding key (as used in fields()).
186 * Array(string $name => string $uniqueName).
188 public static function &fieldKeys() {
189 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
190 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
192 return Civi
::$statics[__CLASS__
]['fieldKeys'];
196 * Returns the names of this table
200 public static function getTableName() {
201 return self
::$_tableName;
205 * Returns if this table needs to be logged
209 public function getLog() {
214 * Returns the list of fields that can be imported
216 * @param bool $prefix
220 public static function &import($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'system_log', $prefix, []);
226 * Returns the list of fields that can be exported
228 * @param bool $prefix
232 public static function &export($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'system_log', $prefix, []);
238 * Returns the list of indices
240 * @param bool $localize
244 public static function indices($localize = TRUE) {
246 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;