commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / CRM / Report / DAO / ReportInstance.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/Report/ReportInstance.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_Report_DAO_ReportInstance extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_report_instance';
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 * Report Instance ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Which Domain is this instance for
90 *
91 * @var int unsigned
92 */
93 public $domain_id;
94 /**
95 * Report Instance Title.
96 *
97 * @var string
98 */
99 public $title;
100 /**
101 * FK to civicrm_option_value for the report template
102 *
103 * @var string
104 */
105 public $report_id;
106 /**
107 * when combined with report_id/template uniquely identifies the instance
108 *
109 * @var string
110 */
111 public $name;
112 /**
113 * arguments that are passed in the url when invoking the instance
114 *
115 * @var string
116 */
117 public $args;
118 /**
119 * Report Instance description.
120 *
121 * @var string
122 */
123 public $description;
124 /**
125 * permission required to be able to run this instance
126 *
127 * @var string
128 */
129 public $permission;
130 /**
131 * role required to be able to run this instance
132 *
133 * @var string
134 */
135 public $grouprole;
136 /**
137 * Submitted form values for this report
138 *
139 * @var text
140 */
141 public $form_values;
142 /**
143 * Is this entry active?
144 *
145 * @var boolean
146 */
147 public $is_active;
148 /**
149 * FK to contact table.
150 *
151 * @var int unsigned
152 */
153 public $created_id;
154 /**
155 * FK to contact table.
156 *
157 * @var int unsigned
158 */
159 public $owner_id;
160 /**
161 * Subject of email
162 *
163 * @var string
164 */
165 public $email_subject;
166 /**
167 * comma-separated list of email addresses to send the report to
168 *
169 * @var text
170 */
171 public $email_to;
172 /**
173 * comma-separated list of email addresses to send the report to
174 *
175 * @var text
176 */
177 public $email_cc;
178 /**
179 * comma-separated list of email addresses to send the report to
180 *
181 * @var text
182 */
183 public $header;
184 /**
185 * comma-separated list of email addresses to send the report to
186 *
187 * @var text
188 */
189 public $footer;
190 /**
191 * FK to navigation ID
192 *
193 * @var int unsigned
194 */
195 public $navigation_id;
196 /**
197 * FK to instance ID drilldown to
198 *
199 * @var int unsigned
200 */
201 public $drilldown_id;
202 /**
203 *
204 * @var boolean
205 */
206 public $is_reserved;
207 /**
208 * class constructor
209 *
210 * @return civicrm_report_instance
211 */
212 function __construct() {
213 $this->__table = 'civicrm_report_instance';
214 parent::__construct();
215 }
216 /**
217 * Returns foreign keys and entity references
218 *
219 * @return array
220 * [CRM_Core_Reference_Interface]
221 */
222 static function getReferenceColumns() {
223 if (!self::$_links) {
224 self::$_links = static ::createReferenceColumns(__CLASS__);
225 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
226 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
227 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'owner_id', 'civicrm_contact', 'id');
228 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'navigation_id', 'civicrm_navigation', 'id');
229 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'drilldown_id', 'civicrm_report_instance', 'id');
230 }
231 return self::$_links;
232 }
233 /**
234 * Returns all the column names of this table
235 *
236 * @return array
237 */
238 static function &fields() {
239 if (!(self::$_fields)) {
240 self::$_fields = array(
241 'id' => array(
242 'name' => 'id',
243 'type' => CRM_Utils_Type::T_INT,
244 'title' => ts('Report Instance ID') ,
245 'description' => 'Report Instance ID',
246 'required' => true,
247 ) ,
248 'domain_id' => array(
249 'name' => 'domain_id',
250 'type' => CRM_Utils_Type::T_INT,
251 'title' => ts('Report Instance Domain ID') ,
252 'description' => 'Which Domain is this instance for',
253 'required' => true,
254 'FKClassName' => 'CRM_Core_DAO_Domain',
255 'pseudoconstant' => array(
256 'table' => 'civicrm_domain',
257 'keyColumn' => 'id',
258 'labelColumn' => 'name',
259 )
260 ) ,
261 'title' => array(
262 'name' => 'title',
263 'type' => CRM_Utils_Type::T_STRING,
264 'title' => ts('Report Instance Title') ,
265 'description' => 'Report Instance Title.',
266 'maxlength' => 255,
267 'size' => CRM_Utils_Type::HUGE,
268 'html' => array(
269 'type' => 'Text',
270 ) ,
271 ) ,
272 'report_id' => array(
273 'name' => 'report_id',
274 'type' => CRM_Utils_Type::T_STRING,
275 'title' => ts('Report template ID') ,
276 'description' => 'FK to civicrm_option_value for the report template',
277 'required' => true,
278 'maxlength' => 64,
279 'size' => CRM_Utils_Type::BIG,
280 'html' => array(
281 'type' => 'Select',
282 ) ,
283 ) ,
284 'name' => array(
285 'name' => 'name',
286 'type' => CRM_Utils_Type::T_STRING,
287 'title' => ts('Report instance Name') ,
288 'description' => 'when combined with report_id/template uniquely identifies the instance',
289 'maxlength' => 255,
290 'size' => CRM_Utils_Type::HUGE,
291 'html' => array(
292 'type' => 'Text',
293 ) ,
294 ) ,
295 'args' => array(
296 'name' => 'args',
297 'type' => CRM_Utils_Type::T_STRING,
298 'title' => ts('Report Instance Arguments') ,
299 'description' => 'arguments that are passed in the url when invoking the instance',
300 'maxlength' => 255,
301 'size' => CRM_Utils_Type::HUGE,
302 'html' => array(
303 'type' => 'Text',
304 ) ,
305 ) ,
306 'description' => array(
307 'name' => 'description',
308 'type' => CRM_Utils_Type::T_STRING,
309 'title' => ts('Report Instance description') ,
310 'description' => 'Report Instance description.',
311 'maxlength' => 255,
312 'size' => CRM_Utils_Type::HUGE,
313 'html' => array(
314 'type' => 'Text',
315 ) ,
316 ) ,
317 'permission' => array(
318 'name' => 'permission',
319 'type' => CRM_Utils_Type::T_STRING,
320 'title' => ts('Report Instance Permissions') ,
321 'description' => 'permission required to be able to run this instance',
322 'maxlength' => 255,
323 'size' => CRM_Utils_Type::HUGE,
324 'html' => array(
325 'type' => 'Text',
326 ) ,
327 ) ,
328 'grouprole' => array(
329 'name' => 'grouprole',
330 'type' => CRM_Utils_Type::T_STRING,
331 'title' => ts('Report Instance Assigned to Roles') ,
332 'description' => 'role required to be able to run this instance',
333 'maxlength' => 1024,
334 'size' => CRM_Utils_Type::HUGE,
335 'html' => array(
336 'type' => 'Text',
337 ) ,
338 ) ,
339 'form_values' => array(
340 'name' => 'form_values',
341 'type' => CRM_Utils_Type::T_TEXT,
342 'title' => ts('Submitted Form Values') ,
343 'description' => 'Submitted form values for this report',
344 'import' => true,
345 'where' => 'civicrm_report_instance.form_values',
346 'headerPattern' => '',
347 'dataPattern' => '',
348 'export' => true,
349 ) ,
350 'is_active' => array(
351 'name' => 'is_active',
352 'type' => CRM_Utils_Type::T_BOOLEAN,
353 'title' => ts('Report Instance is Active') ,
354 'description' => 'Is this entry active?',
355 'html' => array(
356 'type' => 'CheckBox',
357 ) ,
358 ) ,
359 'created_id' => array(
360 'name' => 'created_id',
361 'type' => CRM_Utils_Type::T_INT,
362 'title' => ts('Report Instance Created By') ,
363 'description' => 'FK to contact table.',
364 'FKClassName' => 'CRM_Contact_DAO_Contact',
365 ) ,
366 'owner_id' => array(
367 'name' => 'owner_id',
368 'type' => CRM_Utils_Type::T_INT,
369 'title' => ts('Report Instance Owned By') ,
370 'description' => 'FK to contact table.',
371 'FKClassName' => 'CRM_Contact_DAO_Contact',
372 ) ,
373 'email_subject' => array(
374 'name' => 'email_subject',
375 'type' => CRM_Utils_Type::T_STRING,
376 'title' => ts('Report Instance email Subject') ,
377 'description' => 'Subject of email',
378 'maxlength' => 255,
379 'size' => CRM_Utils_Type::HUGE,
380 'html' => array(
381 'type' => 'Text',
382 ) ,
383 ) ,
384 'email_to' => array(
385 'name' => 'email_to',
386 'type' => CRM_Utils_Type::T_TEXT,
387 'title' => ts('Email Report Instance To') ,
388 'description' => 'comma-separated list of email addresses to send the report to',
389 'html' => array(
390 'type' => 'Text',
391 ) ,
392 ) ,
393 'email_cc' => array(
394 'name' => 'email_cc',
395 'type' => CRM_Utils_Type::T_TEXT,
396 'title' => ts('cc Email Report Instance To') ,
397 'description' => 'comma-separated list of email addresses to send the report to',
398 'html' => array(
399 'type' => 'Text',
400 ) ,
401 ) ,
402 'header' => array(
403 'name' => 'header',
404 'type' => CRM_Utils_Type::T_TEXT,
405 'title' => ts('Report Instance Header') ,
406 'description' => 'comma-separated list of email addresses to send the report to',
407 'rows' => 4,
408 'cols' => 60,
409 'html' => array(
410 'type' => 'TextArea',
411 ) ,
412 ) ,
413 'footer' => array(
414 'name' => 'footer',
415 'type' => CRM_Utils_Type::T_TEXT,
416 'title' => ts('Report Instance Footer') ,
417 'description' => 'comma-separated list of email addresses to send the report to',
418 'rows' => 4,
419 'cols' => 60,
420 'html' => array(
421 'type' => 'TextArea',
422 ) ,
423 ) ,
424 'navigation_id' => array(
425 'name' => 'navigation_id',
426 'type' => CRM_Utils_Type::T_INT,
427 'title' => ts('Navigation ID') ,
428 'description' => 'FK to navigation ID',
429 'import' => true,
430 'where' => 'civicrm_report_instance.navigation_id',
431 'headerPattern' => '',
432 'dataPattern' => '',
433 'export' => true,
434 'FKClassName' => 'CRM_Core_DAO_Navigation',
435 ) ,
436 'drilldown_id' => array(
437 'name' => 'drilldown_id',
438 'type' => CRM_Utils_Type::T_INT,
439 'title' => ts('Drilldown Report ID') ,
440 'description' => 'FK to instance ID drilldown to',
441 'import' => true,
442 'where' => 'civicrm_report_instance.drilldown_id',
443 'headerPattern' => '',
444 'dataPattern' => '',
445 'export' => true,
446 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
447 ) ,
448 'is_reserved' => array(
449 'name' => 'is_reserved',
450 'type' => CRM_Utils_Type::T_BOOLEAN,
451 'title' => ts('Instance is Reserved') ,
452 'html' => array(
453 'type' => 'CheckBox',
454 ) ,
455 ) ,
456 );
457 }
458 return self::$_fields;
459 }
460 /**
461 * Returns an array containing, for each field, the arary key used for that
462 * field in self::$_fields.
463 *
464 * @return array
465 */
466 static function &fieldKeys() {
467 if (!(self::$_fieldKeys)) {
468 self::$_fieldKeys = array(
469 'id' => 'id',
470 'domain_id' => 'domain_id',
471 'title' => 'title',
472 'report_id' => 'report_id',
473 'name' => 'name',
474 'args' => 'args',
475 'description' => 'description',
476 'permission' => 'permission',
477 'grouprole' => 'grouprole',
478 'form_values' => 'form_values',
479 'is_active' => 'is_active',
480 'created_id' => 'created_id',
481 'owner_id' => 'owner_id',
482 'email_subject' => 'email_subject',
483 'email_to' => 'email_to',
484 'email_cc' => 'email_cc',
485 'header' => 'header',
486 'footer' => 'footer',
487 'navigation_id' => 'navigation_id',
488 'drilldown_id' => 'drilldown_id',
489 'is_reserved' => 'is_reserved',
490 );
491 }
492 return self::$_fieldKeys;
493 }
494 /**
495 * Returns the names of this table
496 *
497 * @return string
498 */
499 static function getTableName() {
500 return self::$_tableName;
501 }
502 /**
503 * Returns if this table needs to be logged
504 *
505 * @return boolean
506 */
507 function getLog() {
508 return self::$_log;
509 }
510 /**
511 * Returns the list of fields that can be imported
512 *
513 * @param bool $prefix
514 *
515 * @return array
516 */
517 static function &import($prefix = false) {
518 if (!(self::$_import)) {
519 self::$_import = array();
520 $fields = self::fields();
521 foreach($fields as $name => $field) {
522 if (CRM_Utils_Array::value('import', $field)) {
523 if ($prefix) {
524 self::$_import['report_instance'] = & $fields[$name];
525 } else {
526 self::$_import[$name] = & $fields[$name];
527 }
528 }
529 }
530 }
531 return self::$_import;
532 }
533 /**
534 * Returns the list of fields that can be exported
535 *
536 * @param bool $prefix
537 *
538 * @return array
539 */
540 static function &export($prefix = false) {
541 if (!(self::$_export)) {
542 self::$_export = array();
543 $fields = self::fields();
544 foreach($fields as $name => $field) {
545 if (CRM_Utils_Array::value('export', $field)) {
546 if ($prefix) {
547 self::$_export['report_instance'] = & $fields[$name];
548 } else {
549 self::$_export[$name] = & $fields[$name];
550 }
551 }
552 }
553 }
554 return self::$_export;
555 }
556 }