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:4a333db47b94692a5cbc5395fdfcb899)
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';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_report_instance';
27 * Icon associated with this entity.
31 public static $_icon = 'fa-bar-chart';
34 * Should CiviCRM log any modifications to this table in the civicrm_log table.
38 public static $_log = FALSE;
48 * Which Domain is this instance for
55 * Report Instance Title.
62 * FK to civicrm_option_value for the report template
69 * when combined with report_id/template uniquely identifies the instance
76 * arguments that are passed in the url when invoking the instance
83 * Report Instance description.
90 * permission required to be able to run this instance
97 * role required to be able to run this instance
104 * Submitted form values for this report
111 * Is this entry active?
118 * FK to contact table.
125 * FK to contact table.
136 public $email_subject;
139 * comma-separated list of email addresses to send the report to
146 * comma-separated list of email addresses to send the report to
153 * comma-separated list of email addresses to send the report to
160 * comma-separated list of email addresses to send the report to
167 * FK to navigation ID
171 public $navigation_id;
174 * FK to instance ID drilldown to
178 public $drilldown_id;
188 public function __construct() {
189 $this->__table
= 'civicrm_report_instance';
190 parent
::__construct();
194 * Returns localized title of this entity.
196 * @param bool $plural
197 * Whether to return the plural version of the title.
199 public static function getEntityTitle($plural = FALSE) {
200 return $plural ?
ts('Reports') : ts('Report');
204 * Returns foreign keys and entity references.
207 * [CRM_Core_Reference_Interface]
209 public static function getReferenceColumns() {
210 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
211 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
212 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
213 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
214 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'owner_id', 'civicrm_contact', 'id');
215 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'navigation_id', 'civicrm_navigation', 'id');
216 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'drilldown_id', 'civicrm_report_instance', 'id');
217 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
219 return Civi
::$statics[__CLASS__
]['links'];
223 * Returns all the column names of this table
227 public static function &fields() {
228 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
229 Civi
::$statics[__CLASS__
]['fields'] = [
232 'type' => CRM_Utils_Type
::T_INT
,
233 'title' => ts('Report Instance ID'),
234 'description' => ts('Report Instance ID'),
236 'where' => 'civicrm_report_instance.id',
237 'table_name' => 'civicrm_report_instance',
238 'entity' => 'ReportInstance',
239 'bao' => 'CRM_Report_BAO_ReportInstance',
244 'name' => 'domain_id',
245 'type' => CRM_Utils_Type
::T_INT
,
246 'title' => ts('Report Instance Domain ID'),
247 'description' => ts('Which Domain is this instance for'),
249 'where' => 'civicrm_report_instance.domain_id',
250 'table_name' => 'civicrm_report_instance',
251 'entity' => 'ReportInstance',
252 'bao' => 'CRM_Report_BAO_ReportInstance',
254 'FKClassName' => 'CRM_Core_DAO_Domain',
255 'pseudoconstant' => [
256 'table' => 'civicrm_domain',
258 'labelColumn' => 'name',
264 'type' => CRM_Utils_Type
::T_STRING
,
265 'title' => ts('Report Instance Title'),
266 'description' => ts('Report Instance Title.'),
268 'size' => CRM_Utils_Type
::HUGE
,
269 'where' => 'civicrm_report_instance.title',
270 'table_name' => 'civicrm_report_instance',
271 'entity' => 'ReportInstance',
272 'bao' => 'CRM_Report_BAO_ReportInstance',
280 'name' => 'report_id',
281 'type' => CRM_Utils_Type
::T_STRING
,
282 'title' => ts('Report template ID'),
283 'description' => ts('FK to civicrm_option_value for the report template'),
286 'size' => CRM_Utils_Type
::HUGE
,
287 'where' => 'civicrm_report_instance.report_id',
288 'table_name' => 'civicrm_report_instance',
289 'entity' => 'ReportInstance',
290 'bao' => 'CRM_Report_BAO_ReportInstance',
299 'type' => CRM_Utils_Type
::T_STRING
,
300 'title' => ts('Report instance Name'),
301 'description' => ts('when combined with report_id/template uniquely identifies the instance'),
303 'size' => CRM_Utils_Type
::HUGE
,
304 'where' => 'civicrm_report_instance.name',
305 'table_name' => 'civicrm_report_instance',
306 'entity' => 'ReportInstance',
307 'bao' => 'CRM_Report_BAO_ReportInstance',
316 'type' => CRM_Utils_Type
::T_STRING
,
317 'title' => ts('Report Instance Arguments'),
318 'description' => ts('arguments that are passed in the url when invoking the instance'),
320 'size' => CRM_Utils_Type
::HUGE
,
321 'where' => 'civicrm_report_instance.args',
322 'table_name' => 'civicrm_report_instance',
323 'entity' => 'ReportInstance',
324 'bao' => 'CRM_Report_BAO_ReportInstance',
332 'name' => 'description',
333 'type' => CRM_Utils_Type
::T_STRING
,
334 'title' => ts('Report Instance description'),
335 'description' => ts('Report Instance description.'),
337 'size' => CRM_Utils_Type
::HUGE
,
338 'where' => 'civicrm_report_instance.description',
339 'table_name' => 'civicrm_report_instance',
340 'entity' => 'ReportInstance',
341 'bao' => 'CRM_Report_BAO_ReportInstance',
349 'name' => 'permission',
350 'type' => CRM_Utils_Type
::T_STRING
,
351 'title' => ts('Report Instance Permissions'),
352 'description' => ts('permission required to be able to run this instance'),
354 'size' => CRM_Utils_Type
::HUGE
,
355 'where' => 'civicrm_report_instance.permission',
356 'table_name' => 'civicrm_report_instance',
357 'entity' => 'ReportInstance',
358 'bao' => 'CRM_Report_BAO_ReportInstance',
366 'name' => 'grouprole',
367 'type' => CRM_Utils_Type
::T_STRING
,
368 'title' => ts('Report Instance Assigned to Roles'),
369 'description' => ts('role required to be able to run this instance'),
371 'size' => CRM_Utils_Type
::HUGE
,
372 'where' => 'civicrm_report_instance.grouprole',
373 'table_name' => 'civicrm_report_instance',
374 'entity' => 'ReportInstance',
375 'bao' => 'CRM_Report_BAO_ReportInstance',
383 'name' => 'form_values',
384 'type' => CRM_Utils_Type
::T_LONGTEXT
,
385 'title' => ts('Submitted Form Values'),
386 'description' => ts('Submitted form values for this report'),
388 'where' => 'civicrm_report_instance.form_values',
390 'table_name' => 'civicrm_report_instance',
391 'entity' => 'ReportInstance',
392 'bao' => 'CRM_Report_BAO_ReportInstance',
394 'serialize' => self
::SERIALIZE_PHP
,
398 'name' => 'is_active',
399 'type' => CRM_Utils_Type
::T_BOOLEAN
,
400 'title' => ts('Report Instance is Active'),
401 'description' => ts('Is this entry active?'),
402 'where' => 'civicrm_report_instance.is_active',
403 'table_name' => 'civicrm_report_instance',
404 'entity' => 'ReportInstance',
405 'bao' => 'CRM_Report_BAO_ReportInstance',
408 'type' => 'CheckBox',
413 'name' => 'created_id',
414 'type' => CRM_Utils_Type
::T_INT
,
415 'title' => ts('Report Instance Created By'),
416 'description' => ts('FK to contact table.'),
417 'where' => 'civicrm_report_instance.created_id',
418 'table_name' => 'civicrm_report_instance',
419 'entity' => 'ReportInstance',
420 'bao' => 'CRM_Report_BAO_ReportInstance',
422 'FKClassName' => 'CRM_Contact_DAO_Contact',
426 'name' => 'owner_id',
427 'type' => CRM_Utils_Type
::T_INT
,
428 'title' => ts('Report Instance Owned By'),
429 'description' => ts('FK to contact table.'),
430 'where' => 'civicrm_report_instance.owner_id',
431 'table_name' => 'civicrm_report_instance',
432 'entity' => 'ReportInstance',
433 'bao' => 'CRM_Report_BAO_ReportInstance',
435 'FKClassName' => 'CRM_Contact_DAO_Contact',
439 'name' => 'email_subject',
440 'type' => CRM_Utils_Type
::T_STRING
,
441 'title' => ts('Report Instance email Subject'),
442 'description' => ts('Subject of email'),
444 'size' => CRM_Utils_Type
::HUGE
,
445 'where' => 'civicrm_report_instance.email_subject',
446 'table_name' => 'civicrm_report_instance',
447 'entity' => 'ReportInstance',
448 'bao' => 'CRM_Report_BAO_ReportInstance',
456 'name' => 'email_to',
457 'type' => CRM_Utils_Type
::T_TEXT
,
458 'title' => ts('Email Report Instance To'),
459 'description' => ts('comma-separated list of email addresses to send the report to'),
460 'where' => 'civicrm_report_instance.email_to',
461 'table_name' => 'civicrm_report_instance',
462 'entity' => 'ReportInstance',
463 'bao' => 'CRM_Report_BAO_ReportInstance',
471 'name' => 'email_cc',
472 'type' => CRM_Utils_Type
::T_TEXT
,
473 'title' => ts('cc Email Report Instance To'),
474 'description' => ts('comma-separated list of email addresses to send the report to'),
475 'where' => 'civicrm_report_instance.email_cc',
476 'table_name' => 'civicrm_report_instance',
477 'entity' => 'ReportInstance',
478 'bao' => 'CRM_Report_BAO_ReportInstance',
487 'type' => CRM_Utils_Type
::T_TEXT
,
488 'title' => ts('Report Instance Header'),
489 'description' => ts('comma-separated list of email addresses to send the report to'),
492 'where' => 'civicrm_report_instance.header',
493 'table_name' => 'civicrm_report_instance',
494 'entity' => 'ReportInstance',
495 'bao' => 'CRM_Report_BAO_ReportInstance',
498 'type' => 'TextArea',
504 'type' => CRM_Utils_Type
::T_TEXT
,
505 'title' => ts('Report Instance Footer'),
506 'description' => ts('comma-separated list of email addresses to send the report to'),
509 'where' => 'civicrm_report_instance.footer',
510 'table_name' => 'civicrm_report_instance',
511 'entity' => 'ReportInstance',
512 'bao' => 'CRM_Report_BAO_ReportInstance',
515 'type' => 'TextArea',
520 'name' => 'navigation_id',
521 'type' => CRM_Utils_Type
::T_INT
,
522 'title' => ts('Navigation ID'),
523 'description' => ts('FK to navigation ID'),
525 'where' => 'civicrm_report_instance.navigation_id',
527 'table_name' => 'civicrm_report_instance',
528 'entity' => 'ReportInstance',
529 'bao' => 'CRM_Report_BAO_ReportInstance',
531 'FKClassName' => 'CRM_Core_DAO_Navigation',
535 'name' => 'drilldown_id',
536 'type' => CRM_Utils_Type
::T_INT
,
537 'title' => ts('Drilldown Report ID'),
538 'description' => ts('FK to instance ID drilldown to'),
540 'where' => 'civicrm_report_instance.drilldown_id',
542 'table_name' => 'civicrm_report_instance',
543 'entity' => 'ReportInstance',
544 'bao' => 'CRM_Report_BAO_ReportInstance',
546 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
550 'name' => 'is_reserved',
551 'type' => CRM_Utils_Type
::T_BOOLEAN
,
552 'title' => ts('Instance is Reserved'),
553 'where' => 'civicrm_report_instance.is_reserved',
555 'table_name' => 'civicrm_report_instance',
556 'entity' => 'ReportInstance',
557 'bao' => 'CRM_Report_BAO_ReportInstance',
560 'type' => 'CheckBox',
565 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
567 return Civi
::$statics[__CLASS__
]['fields'];
571 * Return a mapping from field-name to the corresponding key (as used in fields()).
574 * Array(string $name => string $uniqueName).
576 public static function &fieldKeys() {
577 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
578 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
580 return Civi
::$statics[__CLASS__
]['fieldKeys'];
584 * Returns the names of this table
588 public static function getTableName() {
589 return self
::$_tableName;
593 * Returns if this table needs to be logged
597 public function getLog() {
602 * Returns the list of fields that can be imported
604 * @param bool $prefix
608 public static function &import($prefix = FALSE) {
609 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'report_instance', $prefix, []);
614 * Returns the list of fields that can be exported
616 * @param bool $prefix
620 public static function &export($prefix = FALSE) {
621 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'report_instance', $prefix, []);
626 * Returns the list of indices
628 * @param bool $localize
632 public static function indices($localize = TRUE) {
634 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;