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:5e7790bacc5ffff1ecfcaada1abeafec)
13 * Database access object for the ReportInstance entity.
15 class CRM_Report_DAO_ReportInstance
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_report_instance';
25 * Icon associated with this entity.
29 public static $_icon = 'fa-bar-chart';
32 * Should CiviCRM log any modifications to this table in the civicrm_log table.
36 public static $_log = FALSE;
46 * Which Domain is this instance for
53 * Report Instance Title.
60 * FK to civicrm_option_value for the report template
67 * when combined with report_id/template uniquely identifies the instance
74 * arguments that are passed in the url when invoking the instance
81 * Report Instance description.
88 * permission required to be able to run this instance
95 * role required to be able to run this instance
102 * Submitted form values for this report
109 * Is this entry active?
116 * FK to contact table.
123 * FK to contact table.
134 public $email_subject;
137 * comma-separated list of email addresses to send the report to
144 * comma-separated list of email addresses to send the report to
151 * comma-separated list of email addresses to send the report to
158 * comma-separated list of email addresses to send the report to
165 * FK to navigation ID
169 public $navigation_id;
172 * FK to instance ID drilldown to
176 public $drilldown_id;
186 public function __construct() {
187 $this->__table
= 'civicrm_report_instance';
188 parent
::__construct();
192 * Returns localized title of this entity.
194 public static function getEntityTitle() {
195 return ts('Reports');
199 * Returns foreign keys and entity references.
202 * [CRM_Core_Reference_Interface]
204 public static function getReferenceColumns() {
205 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
206 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
207 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
208 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
209 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'owner_id', 'civicrm_contact', 'id');
210 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'navigation_id', 'civicrm_navigation', 'id');
211 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'drilldown_id', 'civicrm_report_instance', 'id');
212 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
214 return Civi
::$statics[__CLASS__
]['links'];
218 * Returns all the column names of this table
222 public static function &fields() {
223 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
224 Civi
::$statics[__CLASS__
]['fields'] = [
227 'type' => CRM_Utils_Type
::T_INT
,
228 'title' => ts('Report Instance ID'),
229 'description' => ts('Report Instance ID'),
231 'where' => 'civicrm_report_instance.id',
232 'table_name' => 'civicrm_report_instance',
233 'entity' => 'ReportInstance',
234 'bao' => 'CRM_Report_BAO_ReportInstance',
239 'name' => 'domain_id',
240 'type' => CRM_Utils_Type
::T_INT
,
241 'title' => ts('Report Instance Domain ID'),
242 'description' => ts('Which Domain is this instance for'),
244 'where' => 'civicrm_report_instance.domain_id',
245 'table_name' => 'civicrm_report_instance',
246 'entity' => 'ReportInstance',
247 'bao' => 'CRM_Report_BAO_ReportInstance',
249 'FKClassName' => 'CRM_Core_DAO_Domain',
250 'pseudoconstant' => [
251 'table' => 'civicrm_domain',
253 'labelColumn' => 'name',
259 'type' => CRM_Utils_Type
::T_STRING
,
260 'title' => ts('Report Instance Title'),
261 'description' => ts('Report Instance Title.'),
263 'size' => CRM_Utils_Type
::HUGE
,
264 'where' => 'civicrm_report_instance.title',
265 'table_name' => 'civicrm_report_instance',
266 'entity' => 'ReportInstance',
267 'bao' => 'CRM_Report_BAO_ReportInstance',
275 'name' => 'report_id',
276 'type' => CRM_Utils_Type
::T_STRING
,
277 'title' => ts('Report template ID'),
278 'description' => ts('FK to civicrm_option_value for the report template'),
281 'size' => CRM_Utils_Type
::HUGE
,
282 'where' => 'civicrm_report_instance.report_id',
283 'table_name' => 'civicrm_report_instance',
284 'entity' => 'ReportInstance',
285 'bao' => 'CRM_Report_BAO_ReportInstance',
294 'type' => CRM_Utils_Type
::T_STRING
,
295 'title' => ts('Report instance Name'),
296 'description' => ts('when combined with report_id/template uniquely identifies the instance'),
298 'size' => CRM_Utils_Type
::HUGE
,
299 'where' => 'civicrm_report_instance.name',
300 'table_name' => 'civicrm_report_instance',
301 'entity' => 'ReportInstance',
302 'bao' => 'CRM_Report_BAO_ReportInstance',
311 'type' => CRM_Utils_Type
::T_STRING
,
312 'title' => ts('Report Instance Arguments'),
313 'description' => ts('arguments that are passed in the url when invoking the instance'),
315 'size' => CRM_Utils_Type
::HUGE
,
316 'where' => 'civicrm_report_instance.args',
317 'table_name' => 'civicrm_report_instance',
318 'entity' => 'ReportInstance',
319 'bao' => 'CRM_Report_BAO_ReportInstance',
327 'name' => 'description',
328 'type' => CRM_Utils_Type
::T_STRING
,
329 'title' => ts('Report Instance description'),
330 'description' => ts('Report Instance description.'),
332 'size' => CRM_Utils_Type
::HUGE
,
333 'where' => 'civicrm_report_instance.description',
334 'table_name' => 'civicrm_report_instance',
335 'entity' => 'ReportInstance',
336 'bao' => 'CRM_Report_BAO_ReportInstance',
344 'name' => 'permission',
345 'type' => CRM_Utils_Type
::T_STRING
,
346 'title' => ts('Report Instance Permissions'),
347 'description' => ts('permission required to be able to run this instance'),
349 'size' => CRM_Utils_Type
::HUGE
,
350 'where' => 'civicrm_report_instance.permission',
351 'table_name' => 'civicrm_report_instance',
352 'entity' => 'ReportInstance',
353 'bao' => 'CRM_Report_BAO_ReportInstance',
361 'name' => 'grouprole',
362 'type' => CRM_Utils_Type
::T_STRING
,
363 'title' => ts('Report Instance Assigned to Roles'),
364 'description' => ts('role required to be able to run this instance'),
366 'size' => CRM_Utils_Type
::HUGE
,
367 'where' => 'civicrm_report_instance.grouprole',
368 'table_name' => 'civicrm_report_instance',
369 'entity' => 'ReportInstance',
370 'bao' => 'CRM_Report_BAO_ReportInstance',
378 'name' => 'form_values',
379 'type' => CRM_Utils_Type
::T_LONGTEXT
,
380 'title' => ts('Submitted Form Values'),
381 'description' => ts('Submitted form values for this report'),
383 'where' => 'civicrm_report_instance.form_values',
385 'table_name' => 'civicrm_report_instance',
386 'entity' => 'ReportInstance',
387 'bao' => 'CRM_Report_BAO_ReportInstance',
389 'serialize' => self
::SERIALIZE_PHP
,
393 'name' => 'is_active',
394 'type' => CRM_Utils_Type
::T_BOOLEAN
,
395 'title' => ts('Report Instance is Active'),
396 'description' => ts('Is this entry active?'),
397 'where' => 'civicrm_report_instance.is_active',
398 'table_name' => 'civicrm_report_instance',
399 'entity' => 'ReportInstance',
400 'bao' => 'CRM_Report_BAO_ReportInstance',
403 'type' => 'CheckBox',
408 'name' => 'created_id',
409 'type' => CRM_Utils_Type
::T_INT
,
410 'title' => ts('Report Instance Created By'),
411 'description' => ts('FK to contact table.'),
412 'where' => 'civicrm_report_instance.created_id',
413 'table_name' => 'civicrm_report_instance',
414 'entity' => 'ReportInstance',
415 'bao' => 'CRM_Report_BAO_ReportInstance',
417 'FKClassName' => 'CRM_Contact_DAO_Contact',
421 'name' => 'owner_id',
422 'type' => CRM_Utils_Type
::T_INT
,
423 'title' => ts('Report Instance Owned By'),
424 'description' => ts('FK to contact table.'),
425 'where' => 'civicrm_report_instance.owner_id',
426 'table_name' => 'civicrm_report_instance',
427 'entity' => 'ReportInstance',
428 'bao' => 'CRM_Report_BAO_ReportInstance',
430 'FKClassName' => 'CRM_Contact_DAO_Contact',
434 'name' => 'email_subject',
435 'type' => CRM_Utils_Type
::T_STRING
,
436 'title' => ts('Report Instance email Subject'),
437 'description' => ts('Subject of email'),
439 'size' => CRM_Utils_Type
::HUGE
,
440 'where' => 'civicrm_report_instance.email_subject',
441 'table_name' => 'civicrm_report_instance',
442 'entity' => 'ReportInstance',
443 'bao' => 'CRM_Report_BAO_ReportInstance',
451 'name' => 'email_to',
452 'type' => CRM_Utils_Type
::T_TEXT
,
453 'title' => ts('Email Report Instance To'),
454 'description' => ts('comma-separated list of email addresses to send the report to'),
455 'where' => 'civicrm_report_instance.email_to',
456 'table_name' => 'civicrm_report_instance',
457 'entity' => 'ReportInstance',
458 'bao' => 'CRM_Report_BAO_ReportInstance',
466 'name' => 'email_cc',
467 'type' => CRM_Utils_Type
::T_TEXT
,
468 'title' => ts('cc Email Report Instance To'),
469 'description' => ts('comma-separated list of email addresses to send the report to'),
470 'where' => 'civicrm_report_instance.email_cc',
471 'table_name' => 'civicrm_report_instance',
472 'entity' => 'ReportInstance',
473 'bao' => 'CRM_Report_BAO_ReportInstance',
482 'type' => CRM_Utils_Type
::T_TEXT
,
483 'title' => ts('Report Instance Header'),
484 'description' => ts('comma-separated list of email addresses to send the report to'),
487 'where' => 'civicrm_report_instance.header',
488 'table_name' => 'civicrm_report_instance',
489 'entity' => 'ReportInstance',
490 'bao' => 'CRM_Report_BAO_ReportInstance',
493 'type' => 'TextArea',
499 'type' => CRM_Utils_Type
::T_TEXT
,
500 'title' => ts('Report Instance Footer'),
501 'description' => ts('comma-separated list of email addresses to send the report to'),
504 'where' => 'civicrm_report_instance.footer',
505 'table_name' => 'civicrm_report_instance',
506 'entity' => 'ReportInstance',
507 'bao' => 'CRM_Report_BAO_ReportInstance',
510 'type' => 'TextArea',
515 'name' => 'navigation_id',
516 'type' => CRM_Utils_Type
::T_INT
,
517 'title' => ts('Navigation ID'),
518 'description' => ts('FK to navigation ID'),
520 'where' => 'civicrm_report_instance.navigation_id',
522 'table_name' => 'civicrm_report_instance',
523 'entity' => 'ReportInstance',
524 'bao' => 'CRM_Report_BAO_ReportInstance',
526 'FKClassName' => 'CRM_Core_DAO_Navigation',
530 'name' => 'drilldown_id',
531 'type' => CRM_Utils_Type
::T_INT
,
532 'title' => ts('Drilldown Report ID'),
533 'description' => ts('FK to instance ID drilldown to'),
535 'where' => 'civicrm_report_instance.drilldown_id',
537 'table_name' => 'civicrm_report_instance',
538 'entity' => 'ReportInstance',
539 'bao' => 'CRM_Report_BAO_ReportInstance',
541 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
545 'name' => 'is_reserved',
546 'type' => CRM_Utils_Type
::T_BOOLEAN
,
547 'title' => ts('Instance is Reserved'),
548 'where' => 'civicrm_report_instance.is_reserved',
550 'table_name' => 'civicrm_report_instance',
551 'entity' => 'ReportInstance',
552 'bao' => 'CRM_Report_BAO_ReportInstance',
555 'type' => 'CheckBox',
560 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
562 return Civi
::$statics[__CLASS__
]['fields'];
566 * Return a mapping from field-name to the corresponding key (as used in fields()).
569 * Array(string $name => string $uniqueName).
571 public static function &fieldKeys() {
572 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
573 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
575 return Civi
::$statics[__CLASS__
]['fieldKeys'];
579 * Returns the names of this table
583 public static function getTableName() {
584 return self
::$_tableName;
588 * Returns if this table needs to be logged
592 public function getLog() {
597 * Returns the list of fields that can be imported
599 * @param bool $prefix
603 public static function &import($prefix = FALSE) {
604 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'report_instance', $prefix, []);
609 * Returns the list of fields that can be exported
611 * @param bool $prefix
615 public static function &export($prefix = FALSE) {
616 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'report_instance', $prefix, []);
621 * Returns the list of indices
623 * @param bool $localize
627 public static function indices($localize = TRUE) {
629 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;