commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / CRM / Core / DAO / JobLog.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/JobLog.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_JobLog extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_job_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 * Job log entry Id
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Which Domain is this scheduled job for
90 *
91 * @var int unsigned
92 */
93 public $domain_id;
94 /**
95 * Log entry date
96 *
97 * @var timestamp
98 */
99 public $run_time;
100 /**
101 * Pointer to job id - not a FK though, just for logging purposes
102 *
103 * @var int unsigned
104 */
105 public $job_id;
106 /**
107 * Title of the job
108 *
109 * @var string
110 */
111 public $name;
112 /**
113 * Full path to file containing job script
114 *
115 * @var string
116 */
117 public $command;
118 /**
119 * Title line of log entry
120 *
121 * @var string
122 */
123 public $description;
124 /**
125 * Potential extended data for specific job run (e.g. tracebacks).
126 *
127 * @var text
128 */
129 public $data;
130 /**
131 * class constructor
132 *
133 * @return civicrm_job_log
134 */
135 function __construct() {
136 $this->__table = 'civicrm_job_log';
137 parent::__construct();
138 }
139 /**
140 * Returns foreign keys and entity references
141 *
142 * @return array
143 * [CRM_Core_Reference_Interface]
144 */
145 static function getReferenceColumns() {
146 if (!self::$_links) {
147 self::$_links = static ::createReferenceColumns(__CLASS__);
148 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
149 }
150 return self::$_links;
151 }
152 /**
153 * Returns all the column names of this table
154 *
155 * @return array
156 */
157 static function &fields() {
158 if (!(self::$_fields)) {
159 self::$_fields = array(
160 'id' => array(
161 'name' => 'id',
162 'type' => CRM_Utils_Type::T_INT,
163 'title' => ts('Job Log ID') ,
164 'description' => 'Job log entry Id',
165 'required' => true,
166 ) ,
167 'domain_id' => array(
168 'name' => 'domain_id',
169 'type' => CRM_Utils_Type::T_INT,
170 'title' => ts('Domain ID') ,
171 'description' => 'Which Domain is this scheduled job for',
172 'required' => true,
173 'FKClassName' => 'CRM_Core_DAO_Domain',
174 'pseudoconstant' => array(
175 'table' => 'civicrm_domain',
176 'keyColumn' => 'id',
177 'labelColumn' => 'name',
178 )
179 ) ,
180 'run_time' => array(
181 'name' => 'run_time',
182 'type' => CRM_Utils_Type::T_TIMESTAMP,
183 'title' => ts('Timestamp') ,
184 'description' => 'Log entry date',
185 ) ,
186 'job_id' => array(
187 'name' => 'job_id',
188 'type' => CRM_Utils_Type::T_INT,
189 'title' => ts('Job ID') ,
190 'description' => 'Pointer to job id - not a FK though, just for logging purposes',
191 ) ,
192 'name' => array(
193 'name' => 'name',
194 'type' => CRM_Utils_Type::T_STRING,
195 'title' => ts('Job Name') ,
196 'description' => 'Title of the job',
197 'maxlength' => 255,
198 'size' => CRM_Utils_Type::HUGE,
199 ) ,
200 'command' => array(
201 'name' => 'command',
202 'type' => CRM_Utils_Type::T_STRING,
203 'title' => ts('Command') ,
204 'description' => 'Full path to file containing job script',
205 'maxlength' => 255,
206 'size' => CRM_Utils_Type::HUGE,
207 ) ,
208 'description' => array(
209 'name' => 'description',
210 'type' => CRM_Utils_Type::T_STRING,
211 'title' => ts('Description') ,
212 'description' => 'Title line of log entry',
213 'maxlength' => 255,
214 'size' => CRM_Utils_Type::HUGE,
215 ) ,
216 'data' => array(
217 'name' => 'data',
218 'type' => CRM_Utils_Type::T_TEXT,
219 'title' => ts('Extended Data') ,
220 'description' => 'Potential extended data for specific job run (e.g. tracebacks).',
221 ) ,
222 );
223 }
224 return self::$_fields;
225 }
226 /**
227 * Returns an array containing, for each field, the arary key used for that
228 * field in self::$_fields.
229 *
230 * @return array
231 */
232 static function &fieldKeys() {
233 if (!(self::$_fieldKeys)) {
234 self::$_fieldKeys = array(
235 'id' => 'id',
236 'domain_id' => 'domain_id',
237 'run_time' => 'run_time',
238 'job_id' => 'job_id',
239 'name' => 'name',
240 'command' => 'command',
241 'description' => 'description',
242 'data' => 'data',
243 );
244 }
245 return self::$_fieldKeys;
246 }
247 /**
248 * Returns the names of this table
249 *
250 * @return string
251 */
252 static function getTableName() {
253 return self::$_tableName;
254 }
255 /**
256 * Returns if this table needs to be logged
257 *
258 * @return boolean
259 */
260 function getLog() {
261 return self::$_log;
262 }
263 /**
264 * Returns the list of fields that can be imported
265 *
266 * @param bool $prefix
267 *
268 * @return array
269 */
270 static function &import($prefix = false) {
271 if (!(self::$_import)) {
272 self::$_import = array();
273 $fields = self::fields();
274 foreach($fields as $name => $field) {
275 if (CRM_Utils_Array::value('import', $field)) {
276 if ($prefix) {
277 self::$_import['job_log'] = & $fields[$name];
278 } else {
279 self::$_import[$name] = & $fields[$name];
280 }
281 }
282 }
283 }
284 return self::$_import;
285 }
286 /**
287 * Returns the list of fields that can be exported
288 *
289 * @param bool $prefix
290 *
291 * @return array
292 */
293 static function &export($prefix = false) {
294 if (!(self::$_export)) {
295 self::$_export = array();
296 $fields = self::fields();
297 foreach($fields as $name => $field) {
298 if (CRM_Utils_Array::value('export', $field)) {
299 if ($prefix) {
300 self::$_export['job_log'] = & $fields[$name];
301 } else {
302 self::$_export[$name] = & $fields[$name];
303 }
304 }
305 }
306 }
307 return self::$_export;
308 }
309 }