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:503bbdb4828d88c81aa480d973d67242)
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',
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'),
253 'where' => 'civicrm_report_instance.domain_id',
254 'table_name' => 'civicrm_report_instance',
255 'entity' => 'ReportInstance',
256 'bao' => 'CRM_Report_BAO_ReportInstance',
258 'FKClassName' => 'CRM_Core_DAO_Domain',
260 'label' => ts("Domain"),
262 'pseudoconstant' => [
263 'table' => 'civicrm_domain',
265 'labelColumn' => 'name',
271 'type' => CRM_Utils_Type
::T_STRING
,
272 'title' => ts('Report Instance Title'),
273 'description' => ts('Report Instance Title.'),
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',
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'),
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',
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'),
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',
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'),
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',
339 'name' => 'description',
340 'type' => CRM_Utils_Type
::T_STRING
,
341 'title' => ts('Report Instance description'),
342 'description' => ts('Report Instance description.'),
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',
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'),
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',
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'),
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',
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'),
395 'where' => 'civicrm_report_instance.form_values',
397 'table_name' => 'civicrm_report_instance',
398 'entity' => 'ReportInstance',
399 'bao' => 'CRM_Report_BAO_ReportInstance',
401 'serialize' => self
::SERIALIZE_PHP
,
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',
415 'type' => 'CheckBox',
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',
429 'FKClassName' => 'CRM_Contact_DAO_Contact',
431 'label' => ts("Created By"),
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',
445 'FKClassName' => 'CRM_Contact_DAO_Contact',
447 'label' => ts("Owned By"),
452 'name' => 'email_subject',
453 'type' => CRM_Utils_Type
::T_STRING
,
454 'title' => ts('Report Instance email Subject'),
455 'description' => ts('Subject of email'),
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',
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',
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',
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'),
505 'where' => 'civicrm_report_instance.header',
506 'table_name' => 'civicrm_report_instance',
507 'entity' => 'ReportInstance',
508 'bao' => 'CRM_Report_BAO_ReportInstance',
511 'type' => 'TextArea',
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'),
522 'where' => 'civicrm_report_instance.footer',
523 'table_name' => 'civicrm_report_instance',
524 'entity' => 'ReportInstance',
525 'bao' => 'CRM_Report_BAO_ReportInstance',
528 'type' => 'TextArea',
533 'name' => 'navigation_id',
534 'type' => CRM_Utils_Type
::T_INT
,
535 'title' => ts('Navigation ID'),
536 'description' => ts('FK to navigation ID'),
538 'where' => 'civicrm_report_instance.navigation_id',
540 'table_name' => 'civicrm_report_instance',
541 'entity' => 'ReportInstance',
542 'bao' => 'CRM_Report_BAO_ReportInstance',
544 'FKClassName' => 'CRM_Core_DAO_Navigation',
546 'label' => ts("Navigation"),
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'),
556 'where' => 'civicrm_report_instance.drilldown_id',
558 'table_name' => 'civicrm_report_instance',
559 'entity' => 'ReportInstance',
560 'bao' => 'CRM_Report_BAO_ReportInstance',
562 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
564 'label' => ts("Drilldown Report"),
569 'name' => 'is_reserved',
570 'type' => CRM_Utils_Type
::T_BOOLEAN
,
571 'title' => ts('Instance is Reserved'),
572 'where' => 'civicrm_report_instance.is_reserved',
574 'table_name' => 'civicrm_report_instance',
575 'entity' => 'ReportInstance',
576 'bao' => 'CRM_Report_BAO_ReportInstance',
579 'type' => 'CheckBox',
584 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
586 return Civi
::$statics[__CLASS__
]['fields'];
590 * Return a mapping from field-name to the corresponding key (as used in fields()).
593 * Array(string $name => string $uniqueName).
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()));
599 return Civi
::$statics[__CLASS__
]['fieldKeys'];
603 * Returns the names of this table
607 public static function getTableName() {
608 return self
::$_tableName;
612 * Returns if this table needs to be logged
616 public function getLog() {
621 * Returns the list of fields that can be imported
623 * @param bool $prefix
627 public static function &import($prefix = FALSE) {
628 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'report_instance', $prefix, []);
633 * Returns the list of fields that can be exported
635 * @param bool $prefix
639 public static function &export($prefix = FALSE) {
640 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'report_instance', $prefix, []);
645 * Returns the list of indices
647 * @param bool $localize
651 public static function indices($localize = TRUE) {
653 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;