5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Report/ReportInstance.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:7c11a51cc566e33761a9f06522c43bbd)
13 * Database access object for the ReportInstance entity.
15 class CRM_Report_DAO_ReportInstance
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.2';
18 const COMPONENT
= 'CiviReport';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_report_instance';
28 * Icon associated with this entity.
32 public static $_icon = 'fa-bar-chart';
35 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 public static $_log = FALSE;
49 * Which Domain is this instance for
56 * Report Instance Title.
63 * FK to civicrm_option_value for the report template
70 * when combined with report_id/template uniquely identifies the instance
77 * arguments that are passed in the url when invoking the instance
84 * Report Instance description.
91 * permission required to be able to run this instance
98 * role required to be able to run this instance
105 * Submitted form values for this report
112 * Is this entry active?
119 * FK to contact table.
126 * FK to contact table.
137 public $email_subject;
140 * comma-separated list of email addresses to send the report to
147 * comma-separated list of email addresses to send the report to
154 * comma-separated list of email addresses to send the report to
161 * comma-separated list of email addresses to send the report to
168 * FK to navigation ID
172 public $navigation_id;
175 * FK to instance ID drilldown to
179 public $drilldown_id;
189 public function __construct() {
190 $this->__table
= 'civicrm_report_instance';
191 parent
::__construct();
195 * Returns localized title of this entity.
197 * @param bool $plural
198 * Whether to return the plural version of the title.
200 public static function getEntityTitle($plural = FALSE) {
201 return $plural ?
ts('Reports') : ts('Report');
205 * Returns foreign keys and entity references.
208 * [CRM_Core_Reference_Interface]
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']);
220 return Civi
::$statics[__CLASS__
]['links'];
224 * Returns all the column names of this table
228 public static function &fields() {
229 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
230 Civi
::$statics[__CLASS__
]['fields'] = [
233 'type' => CRM_Utils_Type
::T_INT
,
234 'title' => ts('Report Instance ID'),
235 'description' => ts('Report Instance ID'),
237 'where' => 'civicrm_report_instance.id',
238 'table_name' => 'civicrm_report_instance',
239 'entity' => 'ReportInstance',
240 'bao' => 'CRM_Report_BAO_ReportInstance',
245 'name' => 'domain_id',
246 'type' => CRM_Utils_Type
::T_INT
,
247 'title' => ts('Report Instance Domain ID'),
248 'description' => ts('Which Domain is this instance for'),
250 'where' => 'civicrm_report_instance.domain_id',
251 'table_name' => 'civicrm_report_instance',
252 'entity' => 'ReportInstance',
253 'bao' => 'CRM_Report_BAO_ReportInstance',
255 'FKClassName' => 'CRM_Core_DAO_Domain',
256 'pseudoconstant' => [
257 'table' => 'civicrm_domain',
259 'labelColumn' => 'name',
265 'type' => CRM_Utils_Type
::T_STRING
,
266 'title' => ts('Report Instance Title'),
267 'description' => ts('Report Instance Title.'),
269 'size' => CRM_Utils_Type
::HUGE
,
270 'where' => 'civicrm_report_instance.title',
271 'table_name' => 'civicrm_report_instance',
272 'entity' => 'ReportInstance',
273 'bao' => 'CRM_Report_BAO_ReportInstance',
281 'name' => 'report_id',
282 'type' => CRM_Utils_Type
::T_STRING
,
283 'title' => ts('Report template ID'),
284 'description' => ts('FK to civicrm_option_value for the report template'),
287 'size' => CRM_Utils_Type
::HUGE
,
288 'where' => 'civicrm_report_instance.report_id',
289 'table_name' => 'civicrm_report_instance',
290 'entity' => 'ReportInstance',
291 'bao' => 'CRM_Report_BAO_ReportInstance',
300 'type' => CRM_Utils_Type
::T_STRING
,
301 'title' => ts('Report instance Name'),
302 'description' => ts('when combined with report_id/template uniquely identifies the instance'),
304 'size' => CRM_Utils_Type
::HUGE
,
305 'where' => 'civicrm_report_instance.name',
306 'table_name' => 'civicrm_report_instance',
307 'entity' => 'ReportInstance',
308 'bao' => 'CRM_Report_BAO_ReportInstance',
317 'type' => CRM_Utils_Type
::T_STRING
,
318 'title' => ts('Report Instance Arguments'),
319 'description' => ts('arguments that are passed in the url when invoking the instance'),
321 'size' => CRM_Utils_Type
::HUGE
,
322 'where' => 'civicrm_report_instance.args',
323 'table_name' => 'civicrm_report_instance',
324 'entity' => 'ReportInstance',
325 'bao' => 'CRM_Report_BAO_ReportInstance',
333 'name' => 'description',
334 'type' => CRM_Utils_Type
::T_STRING
,
335 'title' => ts('Report Instance description'),
336 'description' => ts('Report Instance description.'),
338 'size' => CRM_Utils_Type
::HUGE
,
339 'where' => 'civicrm_report_instance.description',
340 'table_name' => 'civicrm_report_instance',
341 'entity' => 'ReportInstance',
342 'bao' => 'CRM_Report_BAO_ReportInstance',
350 'name' => 'permission',
351 'type' => CRM_Utils_Type
::T_STRING
,
352 'title' => ts('Report Instance Permissions'),
353 'description' => ts('permission required to be able to run this instance'),
355 'size' => CRM_Utils_Type
::HUGE
,
356 'where' => 'civicrm_report_instance.permission',
357 'table_name' => 'civicrm_report_instance',
358 'entity' => 'ReportInstance',
359 'bao' => 'CRM_Report_BAO_ReportInstance',
367 'name' => 'grouprole',
368 'type' => CRM_Utils_Type
::T_STRING
,
369 'title' => ts('Report Instance Assigned to Roles'),
370 'description' => ts('role required to be able to run this instance'),
372 'size' => CRM_Utils_Type
::HUGE
,
373 'where' => 'civicrm_report_instance.grouprole',
374 'table_name' => 'civicrm_report_instance',
375 'entity' => 'ReportInstance',
376 'bao' => 'CRM_Report_BAO_ReportInstance',
384 'name' => 'form_values',
385 'type' => CRM_Utils_Type
::T_LONGTEXT
,
386 'title' => ts('Submitted Form Values'),
387 'description' => ts('Submitted form values for this report'),
389 'where' => 'civicrm_report_instance.form_values',
391 'table_name' => 'civicrm_report_instance',
392 'entity' => 'ReportInstance',
393 'bao' => 'CRM_Report_BAO_ReportInstance',
395 'serialize' => self
::SERIALIZE_PHP
,
399 'name' => 'is_active',
400 'type' => CRM_Utils_Type
::T_BOOLEAN
,
401 'title' => ts('Report Instance is Active'),
402 'description' => ts('Is this entry active?'),
403 'where' => 'civicrm_report_instance.is_active',
404 'table_name' => 'civicrm_report_instance',
405 'entity' => 'ReportInstance',
406 'bao' => 'CRM_Report_BAO_ReportInstance',
409 'type' => 'CheckBox',
414 'name' => 'created_id',
415 'type' => CRM_Utils_Type
::T_INT
,
416 'title' => ts('Report Instance Created By'),
417 'description' => ts('FK to contact table.'),
418 'where' => 'civicrm_report_instance.created_id',
419 'table_name' => 'civicrm_report_instance',
420 'entity' => 'ReportInstance',
421 'bao' => 'CRM_Report_BAO_ReportInstance',
423 'FKClassName' => 'CRM_Contact_DAO_Contact',
427 'name' => 'owner_id',
428 'type' => CRM_Utils_Type
::T_INT
,
429 'title' => ts('Report Instance Owned By'),
430 'description' => ts('FK to contact table.'),
431 'where' => 'civicrm_report_instance.owner_id',
432 'table_name' => 'civicrm_report_instance',
433 'entity' => 'ReportInstance',
434 'bao' => 'CRM_Report_BAO_ReportInstance',
436 'FKClassName' => 'CRM_Contact_DAO_Contact',
440 'name' => 'email_subject',
441 'type' => CRM_Utils_Type
::T_STRING
,
442 'title' => ts('Report Instance email Subject'),
443 'description' => ts('Subject of email'),
445 'size' => CRM_Utils_Type
::HUGE
,
446 'where' => 'civicrm_report_instance.email_subject',
447 'table_name' => 'civicrm_report_instance',
448 'entity' => 'ReportInstance',
449 'bao' => 'CRM_Report_BAO_ReportInstance',
457 'name' => 'email_to',
458 'type' => CRM_Utils_Type
::T_TEXT
,
459 'title' => ts('Email Report Instance To'),
460 'description' => ts('comma-separated list of email addresses to send the report to'),
461 'where' => 'civicrm_report_instance.email_to',
462 'table_name' => 'civicrm_report_instance',
463 'entity' => 'ReportInstance',
464 'bao' => 'CRM_Report_BAO_ReportInstance',
472 'name' => 'email_cc',
473 'type' => CRM_Utils_Type
::T_TEXT
,
474 'title' => ts('cc Email Report Instance To'),
475 'description' => ts('comma-separated list of email addresses to send the report to'),
476 'where' => 'civicrm_report_instance.email_cc',
477 'table_name' => 'civicrm_report_instance',
478 'entity' => 'ReportInstance',
479 'bao' => 'CRM_Report_BAO_ReportInstance',
488 'type' => CRM_Utils_Type
::T_TEXT
,
489 'title' => ts('Report Instance Header'),
490 'description' => ts('comma-separated list of email addresses to send the report to'),
493 'where' => 'civicrm_report_instance.header',
494 'table_name' => 'civicrm_report_instance',
495 'entity' => 'ReportInstance',
496 'bao' => 'CRM_Report_BAO_ReportInstance',
499 'type' => 'TextArea',
505 'type' => CRM_Utils_Type
::T_TEXT
,
506 'title' => ts('Report Instance Footer'),
507 'description' => ts('comma-separated list of email addresses to send the report to'),
510 'where' => 'civicrm_report_instance.footer',
511 'table_name' => 'civicrm_report_instance',
512 'entity' => 'ReportInstance',
513 'bao' => 'CRM_Report_BAO_ReportInstance',
516 'type' => 'TextArea',
521 'name' => 'navigation_id',
522 'type' => CRM_Utils_Type
::T_INT
,
523 'title' => ts('Navigation ID'),
524 'description' => ts('FK to navigation ID'),
526 'where' => 'civicrm_report_instance.navigation_id',
528 'table_name' => 'civicrm_report_instance',
529 'entity' => 'ReportInstance',
530 'bao' => 'CRM_Report_BAO_ReportInstance',
532 'FKClassName' => 'CRM_Core_DAO_Navigation',
536 'name' => 'drilldown_id',
537 'type' => CRM_Utils_Type
::T_INT
,
538 'title' => ts('Drilldown Report ID'),
539 'description' => ts('FK to instance ID drilldown to'),
541 'where' => 'civicrm_report_instance.drilldown_id',
543 'table_name' => 'civicrm_report_instance',
544 'entity' => 'ReportInstance',
545 'bao' => 'CRM_Report_BAO_ReportInstance',
547 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
551 'name' => 'is_reserved',
552 'type' => CRM_Utils_Type
::T_BOOLEAN
,
553 'title' => ts('Instance is Reserved'),
554 'where' => 'civicrm_report_instance.is_reserved',
556 'table_name' => 'civicrm_report_instance',
557 'entity' => 'ReportInstance',
558 'bao' => 'CRM_Report_BAO_ReportInstance',
561 'type' => 'CheckBox',
566 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
568 return Civi
::$statics[__CLASS__
]['fields'];
572 * Return a mapping from field-name to the corresponding key (as used in fields()).
575 * Array(string $name => string $uniqueName).
577 public static function &fieldKeys() {
578 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
579 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
581 return Civi
::$statics[__CLASS__
]['fieldKeys'];
585 * Returns the names of this table
589 public static function getTableName() {
590 return self
::$_tableName;
594 * Returns if this table needs to be logged
598 public function getLog() {
603 * Returns the list of fields that can be imported
605 * @param bool $prefix
609 public static function &import($prefix = FALSE) {
610 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'report_instance', $prefix, []);
615 * Returns the list of fields that can be exported
617 * @param bool $prefix
621 public static function &export($prefix = FALSE) {
622 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'report_instance', $prefix, []);
627 * Returns the list of indices
629 * @param bool $localize
633 public static function indices($localize = TRUE) {
635 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;