3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/SystemLog.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:593327a2dbc09824972cc4d44fbd6893)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_SystemLog constructor.
40 class CRM_Core_DAO_SystemLog
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_system_log';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Standardized message
72 * error level per PSR3
78 * Timestamp of when event occurred.
84 * Optional Contact ID that created the log. Not an FK as we keep this regardless
90 * Optional Name of logging host
98 function __construct() {
99 $this->__table
= 'civicrm_system_log';
100 parent
::__construct();
103 * Returns all the column names of this table
107 static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = array(
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('System Log ID') ,
114 'description' => 'Primary key ID',
116 'table_name' => 'civicrm_system_log',
117 'entity' => 'SystemLog',
118 'bao' => 'CRM_Core_DAO_SystemLog',
122 'type' => CRM_Utils_Type
::T_STRING
,
123 'title' => ts('System Log Message') ,
124 'description' => 'Standardized message',
127 'size' => CRM_Utils_Type
::HUGE
,
128 'table_name' => 'civicrm_system_log',
129 'entity' => 'SystemLog',
130 'bao' => 'CRM_Core_DAO_SystemLog',
134 'type' => CRM_Utils_Type
::T_LONGTEXT
,
135 'title' => ts('Detailed Log Data') ,
136 'description' => 'JSON encoded data',
137 'table_name' => 'civicrm_system_log',
138 'entity' => 'SystemLog',
139 'bao' => 'CRM_Core_DAO_SystemLog',
143 'type' => CRM_Utils_Type
::T_STRING
,
144 'title' => ts('Detailed Log Data') ,
145 'description' => 'error level per PSR3',
147 'size' => CRM_Utils_Type
::TWELVE
,
149 'table_name' => 'civicrm_system_log',
150 'entity' => 'SystemLog',
151 'bao' => 'CRM_Core_DAO_SystemLog',
153 'timestamp' => array(
154 'name' => 'timestamp',
155 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
156 'title' => ts('Log Timestamp') ,
157 'description' => 'Timestamp of when event occurred.',
158 'default' => 'CURRENT_TIMESTAMP',
159 'table_name' => 'civicrm_system_log',
160 'entity' => 'SystemLog',
161 'bao' => 'CRM_Core_DAO_SystemLog',
163 'contact_id' => array(
164 'name' => 'contact_id',
165 'type' => CRM_Utils_Type
::T_INT
,
166 'title' => ts('Log Contact ID') ,
167 'description' => 'Optional Contact ID that created the log. Not an FK as we keep this regardless',
168 'table_name' => 'civicrm_system_log',
169 'entity' => 'SystemLog',
170 'bao' => 'CRM_Core_DAO_SystemLog',
173 'name' => 'hostname',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Log Host') ,
176 'description' => 'Optional Name of logging host',
178 'size' => CRM_Utils_Type
::HUGE
,
179 'table_name' => 'civicrm_system_log',
180 'entity' => 'SystemLog',
181 'bao' => 'CRM_Core_DAO_SystemLog',
184 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
186 return Civi
::$statics[__CLASS__
]['fields'];
189 * Return a mapping from field-name to the corresponding key (as used in fields()).
192 * Array(string $name => string $uniqueName).
194 static function &fieldKeys() {
195 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
196 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
198 return Civi
::$statics[__CLASS__
]['fieldKeys'];
201 * Returns the names of this table
205 static function getTableName() {
206 return self
::$_tableName;
209 * Returns if this table needs to be logged
217 * Returns the list of fields that can be imported
219 * @param bool $prefix
223 static function &import($prefix = false) {
224 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'system_log', $prefix, array());
228 * Returns the list of fields that can be exported
230 * @param bool $prefix
234 static function &export($prefix = false) {
235 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'system_log', $prefix, array());