commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / CRM / Core / DAO / SystemLog.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2015
30 *
31 * Generated from xml/schema/CRM/Core/SystemLog.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Core_DAO_SystemLog extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_system_log';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = false;
82 /**
83 * Primary key ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Standardized message
90 *
91 * @var string
92 */
93 public $message;
94 /**
95 * JSON encoded data
96 *
97 * @var longtext
98 */
99 public $context;
100 /**
101 * error level per PSR3
102 *
103 * @var string
104 */
105 public $level;
106 /**
107 * Timestamp of when event occurred.
108 *
109 * @var timestamp
110 */
111 public $timestamp;
112 /**
113 * Optional Contact ID that created the log. Not an FK as we keep this regardless
114 *
115 * @var int unsigned
116 */
117 public $contact_id;
118 /**
119 * Optional Name of logging host
120 *
121 * @var string
122 */
123 public $hostname;
124 /**
125 * class constructor
126 *
127 * @return civicrm_system_log
128 */
129 function __construct() {
130 $this->__table = 'civicrm_system_log';
131 parent::__construct();
132 }
133 /**
134 * Returns all the column names of this table
135 *
136 * @return array
137 */
138 static function &fields() {
139 if (!(self::$_fields)) {
140 self::$_fields = array(
141 'id' => array(
142 'name' => 'id',
143 'type' => CRM_Utils_Type::T_INT,
144 'title' => ts('System Log ID') ,
145 'description' => 'Primary key ID',
146 'required' => true,
147 ) ,
148 'message' => array(
149 'name' => 'message',
150 'type' => CRM_Utils_Type::T_STRING,
151 'title' => ts('System Log Message') ,
152 'description' => 'Standardized message',
153 'required' => true,
154 'maxlength' => 128,
155 'size' => CRM_Utils_Type::HUGE,
156 ) ,
157 'context' => array(
158 'name' => 'context',
159 'type' => CRM_Utils_Type::T_LONGTEXT,
160 'title' => ts('Detailed Log Data') ,
161 'description' => 'JSON encoded data',
162 ) ,
163 'level' => array(
164 'name' => 'level',
165 'type' => CRM_Utils_Type::T_STRING,
166 'title' => ts('Detailed Log Data') ,
167 'description' => 'error level per PSR3',
168 'maxlength' => 9,
169 'size' => CRM_Utils_Type::TWELVE,
170 'default' => 'info',
171 ) ,
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',
178 ) ,
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',
184 ) ,
185 'hostname' => array(
186 'name' => 'hostname',
187 'type' => CRM_Utils_Type::T_STRING,
188 'title' => ts('Log Host') ,
189 'description' => 'Optional Name of logging host',
190 'maxlength' => 128,
191 'size' => CRM_Utils_Type::HUGE,
192 ) ,
193 );
194 }
195 return self::$_fields;
196 }
197 /**
198 * Returns an array containing, for each field, the arary key used for that
199 * field in self::$_fields.
200 *
201 * @return array
202 */
203 static function &fieldKeys() {
204 if (!(self::$_fieldKeys)) {
205 self::$_fieldKeys = array(
206 'id' => 'id',
207 'message' => 'message',
208 'context' => 'context',
209 'level' => 'level',
210 'timestamp' => 'timestamp',
211 'contact_id' => 'contact_id',
212 'hostname' => 'hostname',
213 );
214 }
215 return self::$_fieldKeys;
216 }
217 /**
218 * Returns the names of this table
219 *
220 * @return string
221 */
222 static function getTableName() {
223 return self::$_tableName;
224 }
225 /**
226 * Returns if this table needs to be logged
227 *
228 * @return boolean
229 */
230 function getLog() {
231 return self::$_log;
232 }
233 /**
234 * Returns the list of fields that can be imported
235 *
236 * @param bool $prefix
237 *
238 * @return array
239 */
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)) {
246 if ($prefix) {
247 self::$_import['system_log'] = & $fields[$name];
248 } else {
249 self::$_import[$name] = & $fields[$name];
250 }
251 }
252 }
253 }
254 return self::$_import;
255 }
256 /**
257 * Returns the list of fields that can be exported
258 *
259 * @param bool $prefix
260 *
261 * @return array
262 */
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)) {
269 if ($prefix) {
270 self::$_export['system_log'] = & $fields[$name];
271 } else {
272 self::$_export[$name] = & $fields[$name];
273 }
274 }
275 }
276 }
277 return self::$_export;
278 }
279 }