3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
31 * Generated from xml/schema/CRM/Core/SystemLog.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Core_DAO_SystemLog
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_system_log';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
89 * Standardized message
101 * error level per PSR3
107 * Timestamp of when event occurred.
113 * Optional Contact ID that created the log. Not an FK as we keep this regardless
119 * Optional Name of logging host
127 * @return civicrm_system_log
129 function __construct() {
130 $this->__table
= 'civicrm_system_log';
131 parent
::__construct();
134 * Returns all the column names of this table
138 static function &fields() {
139 if (!(self
::$_fields)) {
140 self
::$_fields = array(
143 'type' => CRM_Utils_Type
::T_INT
,
144 'title' => ts('System Log ID') ,
145 'description' => 'Primary key ID',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('System Log Message') ,
152 'description' => 'Standardized message',
155 'size' => CRM_Utils_Type
::HUGE
,
159 'type' => CRM_Utils_Type
::T_LONGTEXT
,
160 'title' => ts('Detailed Log Data') ,
161 'description' => 'JSON encoded data',
165 'type' => CRM_Utils_Type
::T_STRING
,
166 'title' => ts('Detailed Log Data') ,
167 'description' => 'error level per PSR3',
169 'size' => CRM_Utils_Type
::TWELVE
,
172 'timestamp' => array(
173 'name' => 'timestamp',
174 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
175 'title' => ts('Log Timestamp') ,
176 'description' => 'Timestamp of when event occurred.',
177 'default' => 'CURRENT_TIMESTAMP',
179 'contact_id' => array(
180 'name' => 'contact_id',
181 'type' => CRM_Utils_Type
::T_INT
,
182 'title' => ts('Log Contact ID') ,
183 'description' => 'Optional Contact ID that created the log. Not an FK as we keep this regardless',
186 'name' => 'hostname',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('Log Host') ,
189 'description' => 'Optional Name of logging host',
191 'size' => CRM_Utils_Type
::HUGE
,
195 return self
::$_fields;
198 * Returns an array containing, for each field, the arary key used for that
199 * field in self::$_fields.
203 static function &fieldKeys() {
204 if (!(self
::$_fieldKeys)) {
205 self
::$_fieldKeys = array(
207 'message' => 'message',
208 'context' => 'context',
210 'timestamp' => 'timestamp',
211 'contact_id' => 'contact_id',
212 'hostname' => 'hostname',
215 return self
::$_fieldKeys;
218 * Returns the names of this table
222 static function getTableName() {
223 return self
::$_tableName;
226 * Returns if this table needs to be logged
234 * Returns the list of fields that can be imported
236 * @param bool $prefix
240 static function &import($prefix = false) {
241 if (!(self
::$_import)) {
242 self
::$_import = array();
243 $fields = self
::fields();
244 foreach($fields as $name => $field) {
245 if (CRM_Utils_Array
::value('import', $field)) {
247 self
::$_import['system_log'] = & $fields[$name];
249 self
::$_import[$name] = & $fields[$name];
254 return self
::$_import;
257 * Returns the list of fields that can be exported
259 * @param bool $prefix
263 static function &export($prefix = false) {
264 if (!(self
::$_export)) {
265 self
::$_export = array();
266 $fields = self
::fields();
267 foreach($fields as $name => $field) {
268 if (CRM_Utils_Array
::value('export', $field)) {
270 self
::$_export['system_log'] = & $fields[$name];
272 self
::$_export[$name] = & $fields[$name];
277 return self
::$_export;