Regenerate DAO files
[civicrm-core.git] / CRM / Report / DAO / ReportInstance.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Report/ReportInstance.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:503bbdb4828d88c81aa480d973d67242)
10 */
11
12 /**
13 * Database access object for the ReportInstance entity.
14 */
15 class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '2.2';
18 const COMPONENT = 'CiviReport';
19
20 /**
21 * Static instance to hold the table name.
22 *
23 * @var string
24 */
25 public static $_tableName = 'civicrm_report_instance';
26
27 /**
28 * Icon associated with this entity.
29 *
30 * @var string
31 */
32 public static $_icon = 'fa-bar-chart';
33
34 /**
35 * Should CiviCRM log any modifications to this table in the civicrm_log table.
36 *
37 * @var bool
38 */
39 public static $_log = FALSE;
40
41 /**
42 * Report Instance ID
43 *
44 * @var int
45 */
46 public $id;
47
48 /**
49 * Which Domain is this instance for
50 *
51 * @var int
52 */
53 public $domain_id;
54
55 /**
56 * Report Instance Title.
57 *
58 * @var string
59 */
60 public $title;
61
62 /**
63 * FK to civicrm_option_value for the report template
64 *
65 * @var string
66 */
67 public $report_id;
68
69 /**
70 * when combined with report_id/template uniquely identifies the instance
71 *
72 * @var string
73 */
74 public $name;
75
76 /**
77 * arguments that are passed in the url when invoking the instance
78 *
79 * @var string
80 */
81 public $args;
82
83 /**
84 * Report Instance description.
85 *
86 * @var string
87 */
88 public $description;
89
90 /**
91 * permission required to be able to run this instance
92 *
93 * @var string
94 */
95 public $permission;
96
97 /**
98 * role required to be able to run this instance
99 *
100 * @var string
101 */
102 public $grouprole;
103
104 /**
105 * Submitted form values for this report
106 *
107 * @var longtext
108 */
109 public $form_values;
110
111 /**
112 * Is this entry active?
113 *
114 * @var bool
115 */
116 public $is_active;
117
118 /**
119 * FK to contact table.
120 *
121 * @var int
122 */
123 public $created_id;
124
125 /**
126 * FK to contact table.
127 *
128 * @var int
129 */
130 public $owner_id;
131
132 /**
133 * Subject of email
134 *
135 * @var string
136 */
137 public $email_subject;
138
139 /**
140 * comma-separated list of email addresses to send the report to
141 *
142 * @var text
143 */
144 public $email_to;
145
146 /**
147 * comma-separated list of email addresses to send the report to
148 *
149 * @var text
150 */
151 public $email_cc;
152
153 /**
154 * comma-separated list of email addresses to send the report to
155 *
156 * @var text
157 */
158 public $header;
159
160 /**
161 * comma-separated list of email addresses to send the report to
162 *
163 * @var text
164 */
165 public $footer;
166
167 /**
168 * FK to navigation ID
169 *
170 * @var int
171 */
172 public $navigation_id;
173
174 /**
175 * FK to instance ID drilldown to
176 *
177 * @var int
178 */
179 public $drilldown_id;
180
181 /**
182 * @var bool
183 */
184 public $is_reserved;
185
186 /**
187 * Class constructor.
188 */
189 public function __construct() {
190 $this->__table = 'civicrm_report_instance';
191 parent::__construct();
192 }
193
194 /**
195 * Returns localized title of this entity.
196 *
197 * @param bool $plural
198 * Whether to return the plural version of the title.
199 */
200 public static function getEntityTitle($plural = FALSE) {
201 return $plural ? ts('Reports') : ts('Report');
202 }
203
204 /**
205 * Returns foreign keys and entity references.
206 *
207 * @return array
208 * [CRM_Core_Reference_Interface]
209 */
210 public static function getReferenceColumns() {
211 if (!isset(Civi::$statics[__CLASS__]['links'])) {
212 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
213 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
214 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
215 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'owner_id', 'civicrm_contact', 'id');
216 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'navigation_id', 'civicrm_navigation', 'id');
217 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'drilldown_id', 'civicrm_report_instance', 'id');
218 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
219 }
220 return Civi::$statics[__CLASS__]['links'];
221 }
222
223 /**
224 * Returns all the column names of this table
225 *
226 * @return array
227 */
228 public static function &fields() {
229 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
230 Civi::$statics[__CLASS__]['fields'] = [
231 'id' => [
232 'name' => 'id',
233 'type' => CRM_Utils_Type::T_INT,
234 'title' => ts('Report Instance ID'),
235 'description' => ts('Report Instance ID'),
236 'required' => TRUE,
237 'where' => 'civicrm_report_instance.id',
238 'table_name' => 'civicrm_report_instance',
239 'entity' => 'ReportInstance',
240 'bao' => 'CRM_Report_BAO_ReportInstance',
241 'localizable' => 0,
242 'html' => [
243 'type' => 'Number',
244 ],
245 'add' => '2.2',
246 ],
247 'domain_id' => [
248 'name' => 'domain_id',
249 'type' => CRM_Utils_Type::T_INT,
250 'title' => ts('Domain ID'),
251 'description' => ts('Which Domain is this instance for'),
252 'required' => TRUE,
253 'where' => 'civicrm_report_instance.domain_id',
254 'table_name' => 'civicrm_report_instance',
255 'entity' => 'ReportInstance',
256 'bao' => 'CRM_Report_BAO_ReportInstance',
257 'localizable' => 0,
258 'FKClassName' => 'CRM_Core_DAO_Domain',
259 'html' => [
260 'label' => ts("Domain"),
261 ],
262 'pseudoconstant' => [
263 'table' => 'civicrm_domain',
264 'keyColumn' => 'id',
265 'labelColumn' => 'name',
266 ],
267 'add' => '3.1',
268 ],
269 'title' => [
270 'name' => 'title',
271 'type' => CRM_Utils_Type::T_STRING,
272 'title' => ts('Report Instance Title'),
273 'description' => ts('Report Instance Title.'),
274 'maxlength' => 255,
275 'size' => CRM_Utils_Type::HUGE,
276 'where' => 'civicrm_report_instance.title',
277 'table_name' => 'civicrm_report_instance',
278 'entity' => 'ReportInstance',
279 'bao' => 'CRM_Report_BAO_ReportInstance',
280 'localizable' => 0,
281 'html' => [
282 'type' => 'Text',
283 ],
284 'add' => '2.2',
285 ],
286 'report_id' => [
287 'name' => 'report_id',
288 'type' => CRM_Utils_Type::T_STRING,
289 'title' => ts('Report template ID'),
290 'description' => ts('FK to civicrm_option_value for the report template'),
291 'required' => TRUE,
292 'maxlength' => 512,
293 'size' => CRM_Utils_Type::HUGE,
294 'where' => 'civicrm_report_instance.report_id',
295 'table_name' => 'civicrm_report_instance',
296 'entity' => 'ReportInstance',
297 'bao' => 'CRM_Report_BAO_ReportInstance',
298 'localizable' => 0,
299 'html' => [
300 'type' => 'Select',
301 ],
302 'add' => '2.2',
303 ],
304 'name' => [
305 'name' => 'name',
306 'type' => CRM_Utils_Type::T_STRING,
307 'title' => ts('Report instance Name'),
308 'description' => ts('when combined with report_id/template uniquely identifies the instance'),
309 'maxlength' => 255,
310 'size' => CRM_Utils_Type::HUGE,
311 'where' => 'civicrm_report_instance.name',
312 'table_name' => 'civicrm_report_instance',
313 'entity' => 'ReportInstance',
314 'bao' => 'CRM_Report_BAO_ReportInstance',
315 'localizable' => 0,
316 'html' => [
317 'type' => 'Text',
318 ],
319 'add' => '3.2',
320 ],
321 'args' => [
322 'name' => 'args',
323 'type' => CRM_Utils_Type::T_STRING,
324 'title' => ts('Report Instance Arguments'),
325 'description' => ts('arguments that are passed in the url when invoking the instance'),
326 'maxlength' => 255,
327 'size' => CRM_Utils_Type::HUGE,
328 'where' => 'civicrm_report_instance.args',
329 'table_name' => 'civicrm_report_instance',
330 'entity' => 'ReportInstance',
331 'bao' => 'CRM_Report_BAO_ReportInstance',
332 'localizable' => 0,
333 'html' => [
334 'type' => 'Text',
335 ],
336 'add' => '3.2',
337 ],
338 'description' => [
339 'name' => 'description',
340 'type' => CRM_Utils_Type::T_STRING,
341 'title' => ts('Report Instance description'),
342 'description' => ts('Report Instance description.'),
343 'maxlength' => 255,
344 'size' => CRM_Utils_Type::HUGE,
345 'where' => 'civicrm_report_instance.description',
346 'table_name' => 'civicrm_report_instance',
347 'entity' => 'ReportInstance',
348 'bao' => 'CRM_Report_BAO_ReportInstance',
349 'localizable' => 0,
350 'html' => [
351 'type' => 'Text',
352 ],
353 'add' => '2.2',
354 ],
355 'permission' => [
356 'name' => 'permission',
357 'type' => CRM_Utils_Type::T_STRING,
358 'title' => ts('Report Instance Permissions'),
359 'description' => ts('permission required to be able to run this instance'),
360 'maxlength' => 255,
361 'size' => CRM_Utils_Type::HUGE,
362 'where' => 'civicrm_report_instance.permission',
363 'table_name' => 'civicrm_report_instance',
364 'entity' => 'ReportInstance',
365 'bao' => 'CRM_Report_BAO_ReportInstance',
366 'localizable' => 0,
367 'html' => [
368 'type' => 'Text',
369 ],
370 'add' => '2.2',
371 ],
372 'grouprole' => [
373 'name' => 'grouprole',
374 'type' => CRM_Utils_Type::T_STRING,
375 'title' => ts('Report Instance Assigned to Roles'),
376 'description' => ts('role required to be able to run this instance'),
377 'maxlength' => 1024,
378 'size' => CRM_Utils_Type::HUGE,
379 'where' => 'civicrm_report_instance.grouprole',
380 'table_name' => 'civicrm_report_instance',
381 'entity' => 'ReportInstance',
382 'bao' => 'CRM_Report_BAO_ReportInstance',
383 'localizable' => 0,
384 'html' => [
385 'type' => 'Text',
386 ],
387 'add' => '4.1',
388 ],
389 'form_values' => [
390 'name' => 'form_values',
391 'type' => CRM_Utils_Type::T_LONGTEXT,
392 'title' => ts('Submitted Form Values'),
393 'description' => ts('Submitted form values for this report'),
394 'import' => TRUE,
395 'where' => 'civicrm_report_instance.form_values',
396 'export' => TRUE,
397 'table_name' => 'civicrm_report_instance',
398 'entity' => 'ReportInstance',
399 'bao' => 'CRM_Report_BAO_ReportInstance',
400 'localizable' => 0,
401 'serialize' => self::SERIALIZE_PHP,
402 'add' => '2.2',
403 ],
404 'is_active' => [
405 'name' => 'is_active',
406 'type' => CRM_Utils_Type::T_BOOLEAN,
407 'title' => ts('Report Instance is Active'),
408 'description' => ts('Is this entry active?'),
409 'where' => 'civicrm_report_instance.is_active',
410 'table_name' => 'civicrm_report_instance',
411 'entity' => 'ReportInstance',
412 'bao' => 'CRM_Report_BAO_ReportInstance',
413 'localizable' => 0,
414 'html' => [
415 'type' => 'CheckBox',
416 ],
417 'add' => '2.2',
418 ],
419 'created_id' => [
420 'name' => 'created_id',
421 'type' => CRM_Utils_Type::T_INT,
422 'title' => ts('Created By Contact ID'),
423 'description' => ts('FK to contact table.'),
424 'where' => 'civicrm_report_instance.created_id',
425 'table_name' => 'civicrm_report_instance',
426 'entity' => 'ReportInstance',
427 'bao' => 'CRM_Report_BAO_ReportInstance',
428 'localizable' => 0,
429 'FKClassName' => 'CRM_Contact_DAO_Contact',
430 'html' => [
431 'label' => ts("Created By"),
432 ],
433 'add' => '4.6',
434 ],
435 'owner_id' => [
436 'name' => 'owner_id',
437 'type' => CRM_Utils_Type::T_INT,
438 'title' => ts('Owned By Contact ID'),
439 'description' => ts('FK to contact table.'),
440 'where' => 'civicrm_report_instance.owner_id',
441 'table_name' => 'civicrm_report_instance',
442 'entity' => 'ReportInstance',
443 'bao' => 'CRM_Report_BAO_ReportInstance',
444 'localizable' => 0,
445 'FKClassName' => 'CRM_Contact_DAO_Contact',
446 'html' => [
447 'label' => ts("Owned By"),
448 ],
449 'add' => '4.6',
450 ],
451 'email_subject' => [
452 'name' => 'email_subject',
453 'type' => CRM_Utils_Type::T_STRING,
454 'title' => ts('Report Instance email Subject'),
455 'description' => ts('Subject of email'),
456 'maxlength' => 255,
457 'size' => CRM_Utils_Type::HUGE,
458 'where' => 'civicrm_report_instance.email_subject',
459 'table_name' => 'civicrm_report_instance',
460 'entity' => 'ReportInstance',
461 'bao' => 'CRM_Report_BAO_ReportInstance',
462 'localizable' => 0,
463 'html' => [
464 'type' => 'Text',
465 ],
466 'add' => NULL,
467 ],
468 'email_to' => [
469 'name' => 'email_to',
470 'type' => CRM_Utils_Type::T_TEXT,
471 'title' => ts('Email Report Instance To'),
472 'description' => ts('comma-separated list of email addresses to send the report to'),
473 'where' => 'civicrm_report_instance.email_to',
474 'table_name' => 'civicrm_report_instance',
475 'entity' => 'ReportInstance',
476 'bao' => 'CRM_Report_BAO_ReportInstance',
477 'localizable' => 0,
478 'html' => [
479 'type' => 'Text',
480 ],
481 'add' => '2.2',
482 ],
483 'email_cc' => [
484 'name' => 'email_cc',
485 'type' => CRM_Utils_Type::T_TEXT,
486 'title' => ts('cc Email Report Instance To'),
487 'description' => ts('comma-separated list of email addresses to send the report to'),
488 'where' => 'civicrm_report_instance.email_cc',
489 'table_name' => 'civicrm_report_instance',
490 'entity' => 'ReportInstance',
491 'bao' => 'CRM_Report_BAO_ReportInstance',
492 'localizable' => 0,
493 'html' => [
494 'type' => 'Text',
495 ],
496 'add' => '2.2',
497 ],
498 'header' => [
499 'name' => 'header',
500 'type' => CRM_Utils_Type::T_TEXT,
501 'title' => ts('Report Instance Header'),
502 'description' => ts('comma-separated list of email addresses to send the report to'),
503 'rows' => 4,
504 'cols' => 60,
505 'where' => 'civicrm_report_instance.header',
506 'table_name' => 'civicrm_report_instance',
507 'entity' => 'ReportInstance',
508 'bao' => 'CRM_Report_BAO_ReportInstance',
509 'localizable' => 0,
510 'html' => [
511 'type' => 'TextArea',
512 ],
513 'add' => '2.2',
514 ],
515 'footer' => [
516 'name' => 'footer',
517 'type' => CRM_Utils_Type::T_TEXT,
518 'title' => ts('Report Instance Footer'),
519 'description' => ts('comma-separated list of email addresses to send the report to'),
520 'rows' => 4,
521 'cols' => 60,
522 'where' => 'civicrm_report_instance.footer',
523 'table_name' => 'civicrm_report_instance',
524 'entity' => 'ReportInstance',
525 'bao' => 'CRM_Report_BAO_ReportInstance',
526 'localizable' => 0,
527 'html' => [
528 'type' => 'TextArea',
529 ],
530 'add' => '2.2',
531 ],
532 'navigation_id' => [
533 'name' => 'navigation_id',
534 'type' => CRM_Utils_Type::T_INT,
535 'title' => ts('Navigation ID'),
536 'description' => ts('FK to navigation ID'),
537 'import' => TRUE,
538 'where' => 'civicrm_report_instance.navigation_id',
539 'export' => TRUE,
540 'table_name' => 'civicrm_report_instance',
541 'entity' => 'ReportInstance',
542 'bao' => 'CRM_Report_BAO_ReportInstance',
543 'localizable' => 0,
544 'FKClassName' => 'CRM_Core_DAO_Navigation',
545 'html' => [
546 'label' => ts("Navigation"),
547 ],
548 'add' => '3.0',
549 ],
550 'drilldown_id' => [
551 'name' => 'drilldown_id',
552 'type' => CRM_Utils_Type::T_INT,
553 'title' => ts('Drilldown Report ID'),
554 'description' => ts('FK to instance ID drilldown to'),
555 'import' => TRUE,
556 'where' => 'civicrm_report_instance.drilldown_id',
557 'export' => TRUE,
558 'table_name' => 'civicrm_report_instance',
559 'entity' => 'ReportInstance',
560 'bao' => 'CRM_Report_BAO_ReportInstance',
561 'localizable' => 0,
562 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
563 'html' => [
564 'label' => ts("Drilldown Report"),
565 ],
566 'add' => '4.3',
567 ],
568 'is_reserved' => [
569 'name' => 'is_reserved',
570 'type' => CRM_Utils_Type::T_BOOLEAN,
571 'title' => ts('Instance is Reserved'),
572 'where' => 'civicrm_report_instance.is_reserved',
573 'default' => '0',
574 'table_name' => 'civicrm_report_instance',
575 'entity' => 'ReportInstance',
576 'bao' => 'CRM_Report_BAO_ReportInstance',
577 'localizable' => 0,
578 'html' => [
579 'type' => 'CheckBox',
580 ],
581 'add' => '4.2',
582 ],
583 ];
584 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
585 }
586 return Civi::$statics[__CLASS__]['fields'];
587 }
588
589 /**
590 * Return a mapping from field-name to the corresponding key (as used in fields()).
591 *
592 * @return array
593 * Array(string $name => string $uniqueName).
594 */
595 public static function &fieldKeys() {
596 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
597 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
598 }
599 return Civi::$statics[__CLASS__]['fieldKeys'];
600 }
601
602 /**
603 * Returns the names of this table
604 *
605 * @return string
606 */
607 public static function getTableName() {
608 return self::$_tableName;
609 }
610
611 /**
612 * Returns if this table needs to be logged
613 *
614 * @return bool
615 */
616 public function getLog() {
617 return self::$_log;
618 }
619
620 /**
621 * Returns the list of fields that can be imported
622 *
623 * @param bool $prefix
624 *
625 * @return array
626 */
627 public static function &import($prefix = FALSE) {
628 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'report_instance', $prefix, []);
629 return $r;
630 }
631
632 /**
633 * Returns the list of fields that can be exported
634 *
635 * @param bool $prefix
636 *
637 * @return array
638 */
639 public static function &export($prefix = FALSE) {
640 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'report_instance', $prefix, []);
641 return $r;
642 }
643
644 /**
645 * Returns the list of indices
646 *
647 * @param bool $localize
648 *
649 * @return array
650 */
651 public static function indices($localize = TRUE) {
652 $indices = [];
653 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
654 }
655
656 }