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:e578602adaab855b72e2aef8992cb97e)
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',
238 'name' => 'domain_id',
239 'type' => CRM_Utils_Type
::T_INT
,
240 'title' => ts('Report Instance Domain ID'),
241 'description' => ts('Which Domain is this instance for'),
243 'where' => 'civicrm_report_instance.domain_id',
244 'table_name' => 'civicrm_report_instance',
245 'entity' => 'ReportInstance',
246 'bao' => 'CRM_Report_BAO_ReportInstance',
248 'FKClassName' => 'CRM_Core_DAO_Domain',
249 'pseudoconstant' => [
250 'table' => 'civicrm_domain',
252 'labelColumn' => 'name',
257 'type' => CRM_Utils_Type
::T_STRING
,
258 'title' => ts('Report Instance Title'),
259 'description' => ts('Report Instance Title.'),
261 'size' => CRM_Utils_Type
::HUGE
,
262 'where' => 'civicrm_report_instance.title',
263 'table_name' => 'civicrm_report_instance',
264 'entity' => 'ReportInstance',
265 'bao' => 'CRM_Report_BAO_ReportInstance',
272 'name' => 'report_id',
273 'type' => CRM_Utils_Type
::T_STRING
,
274 'title' => ts('Report template ID'),
275 'description' => ts('FK to civicrm_option_value for the report template'),
278 'size' => CRM_Utils_Type
::HUGE
,
279 'where' => 'civicrm_report_instance.report_id',
280 'table_name' => 'civicrm_report_instance',
281 'entity' => 'ReportInstance',
282 'bao' => 'CRM_Report_BAO_ReportInstance',
290 'type' => CRM_Utils_Type
::T_STRING
,
291 'title' => ts('Report instance Name'),
292 'description' => ts('when combined with report_id/template uniquely identifies the instance'),
294 'size' => CRM_Utils_Type
::HUGE
,
295 'where' => 'civicrm_report_instance.name',
296 'table_name' => 'civicrm_report_instance',
297 'entity' => 'ReportInstance',
298 'bao' => 'CRM_Report_BAO_ReportInstance',
306 'type' => CRM_Utils_Type
::T_STRING
,
307 'title' => ts('Report Instance Arguments'),
308 'description' => ts('arguments that are passed in the url when invoking the instance'),
310 'size' => CRM_Utils_Type
::HUGE
,
311 'where' => 'civicrm_report_instance.args',
312 'table_name' => 'civicrm_report_instance',
313 'entity' => 'ReportInstance',
314 'bao' => 'CRM_Report_BAO_ReportInstance',
321 'name' => 'description',
322 'type' => CRM_Utils_Type
::T_STRING
,
323 'title' => ts('Report Instance description'),
324 'description' => ts('Report Instance description.'),
326 'size' => CRM_Utils_Type
::HUGE
,
327 'where' => 'civicrm_report_instance.description',
328 'table_name' => 'civicrm_report_instance',
329 'entity' => 'ReportInstance',
330 'bao' => 'CRM_Report_BAO_ReportInstance',
337 'name' => 'permission',
338 'type' => CRM_Utils_Type
::T_STRING
,
339 'title' => ts('Report Instance Permissions'),
340 'description' => ts('permission required to be able to run this instance'),
342 'size' => CRM_Utils_Type
::HUGE
,
343 'where' => 'civicrm_report_instance.permission',
344 'table_name' => 'civicrm_report_instance',
345 'entity' => 'ReportInstance',
346 'bao' => 'CRM_Report_BAO_ReportInstance',
353 'name' => 'grouprole',
354 'type' => CRM_Utils_Type
::T_STRING
,
355 'title' => ts('Report Instance Assigned to Roles'),
356 'description' => ts('role required to be able to run this instance'),
358 'size' => CRM_Utils_Type
::HUGE
,
359 'where' => 'civicrm_report_instance.grouprole',
360 'table_name' => 'civicrm_report_instance',
361 'entity' => 'ReportInstance',
362 'bao' => 'CRM_Report_BAO_ReportInstance',
369 'name' => 'form_values',
370 'type' => CRM_Utils_Type
::T_LONGTEXT
,
371 'title' => ts('Submitted Form Values'),
372 'description' => ts('Submitted form values for this report'),
374 'where' => 'civicrm_report_instance.form_values',
376 'table_name' => 'civicrm_report_instance',
377 'entity' => 'ReportInstance',
378 'bao' => 'CRM_Report_BAO_ReportInstance',
380 'serialize' => self
::SERIALIZE_PHP
,
383 'name' => 'is_active',
384 'type' => CRM_Utils_Type
::T_BOOLEAN
,
385 'title' => ts('Report Instance is Active'),
386 'description' => ts('Is this entry active?'),
387 'where' => 'civicrm_report_instance.is_active',
388 'table_name' => 'civicrm_report_instance',
389 'entity' => 'ReportInstance',
390 'bao' => 'CRM_Report_BAO_ReportInstance',
393 'type' => 'CheckBox',
397 'name' => 'created_id',
398 'type' => CRM_Utils_Type
::T_INT
,
399 'title' => ts('Report Instance Created By'),
400 'description' => ts('FK to contact table.'),
401 'where' => 'civicrm_report_instance.created_id',
402 'table_name' => 'civicrm_report_instance',
403 'entity' => 'ReportInstance',
404 'bao' => 'CRM_Report_BAO_ReportInstance',
406 'FKClassName' => 'CRM_Contact_DAO_Contact',
409 'name' => 'owner_id',
410 'type' => CRM_Utils_Type
::T_INT
,
411 'title' => ts('Report Instance Owned By'),
412 'description' => ts('FK to contact table.'),
413 'where' => 'civicrm_report_instance.owner_id',
414 'table_name' => 'civicrm_report_instance',
415 'entity' => 'ReportInstance',
416 'bao' => 'CRM_Report_BAO_ReportInstance',
418 'FKClassName' => 'CRM_Contact_DAO_Contact',
421 'name' => 'email_subject',
422 'type' => CRM_Utils_Type
::T_STRING
,
423 'title' => ts('Report Instance email Subject'),
424 'description' => ts('Subject of email'),
426 'size' => CRM_Utils_Type
::HUGE
,
427 'where' => 'civicrm_report_instance.email_subject',
428 'table_name' => 'civicrm_report_instance',
429 'entity' => 'ReportInstance',
430 'bao' => 'CRM_Report_BAO_ReportInstance',
437 'name' => 'email_to',
438 'type' => CRM_Utils_Type
::T_TEXT
,
439 'title' => ts('Email Report Instance To'),
440 'description' => ts('comma-separated list of email addresses to send the report to'),
441 'where' => 'civicrm_report_instance.email_to',
442 'table_name' => 'civicrm_report_instance',
443 'entity' => 'ReportInstance',
444 'bao' => 'CRM_Report_BAO_ReportInstance',
451 'name' => 'email_cc',
452 'type' => CRM_Utils_Type
::T_TEXT
,
453 'title' => ts('cc Email Report Instance To'),
454 'description' => ts('comma-separated list of email addresses to send the report to'),
455 'where' => 'civicrm_report_instance.email_cc',
456 'table_name' => 'civicrm_report_instance',
457 'entity' => 'ReportInstance',
458 'bao' => 'CRM_Report_BAO_ReportInstance',
466 'type' => CRM_Utils_Type
::T_TEXT
,
467 'title' => ts('Report Instance Header'),
468 'description' => ts('comma-separated list of email addresses to send the report to'),
471 'where' => 'civicrm_report_instance.header',
472 'table_name' => 'civicrm_report_instance',
473 'entity' => 'ReportInstance',
474 'bao' => 'CRM_Report_BAO_ReportInstance',
477 'type' => 'TextArea',
482 'type' => CRM_Utils_Type
::T_TEXT
,
483 'title' => ts('Report Instance Footer'),
484 'description' => ts('comma-separated list of email addresses to send the report to'),
487 'where' => 'civicrm_report_instance.footer',
488 'table_name' => 'civicrm_report_instance',
489 'entity' => 'ReportInstance',
490 'bao' => 'CRM_Report_BAO_ReportInstance',
493 'type' => 'TextArea',
497 'name' => 'navigation_id',
498 'type' => CRM_Utils_Type
::T_INT
,
499 'title' => ts('Navigation ID'),
500 'description' => ts('FK to navigation ID'),
502 'where' => 'civicrm_report_instance.navigation_id',
504 'table_name' => 'civicrm_report_instance',
505 'entity' => 'ReportInstance',
506 'bao' => 'CRM_Report_BAO_ReportInstance',
508 'FKClassName' => 'CRM_Core_DAO_Navigation',
511 'name' => 'drilldown_id',
512 'type' => CRM_Utils_Type
::T_INT
,
513 'title' => ts('Drilldown Report ID'),
514 'description' => ts('FK to instance ID drilldown to'),
516 'where' => 'civicrm_report_instance.drilldown_id',
518 'table_name' => 'civicrm_report_instance',
519 'entity' => 'ReportInstance',
520 'bao' => 'CRM_Report_BAO_ReportInstance',
522 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
525 'name' => 'is_reserved',
526 'type' => CRM_Utils_Type
::T_BOOLEAN
,
527 'title' => ts('Instance is Reserved'),
528 'where' => 'civicrm_report_instance.is_reserved',
530 'table_name' => 'civicrm_report_instance',
531 'entity' => 'ReportInstance',
532 'bao' => 'CRM_Report_BAO_ReportInstance',
535 'type' => 'CheckBox',
539 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
541 return Civi
::$statics[__CLASS__
]['fields'];
545 * Return a mapping from field-name to the corresponding key (as used in fields()).
548 * Array(string $name => string $uniqueName).
550 public static function &fieldKeys() {
551 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
552 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
554 return Civi
::$statics[__CLASS__
]['fieldKeys'];
558 * Returns the names of this table
562 public static function getTableName() {
563 return self
::$_tableName;
567 * Returns if this table needs to be logged
571 public function getLog() {
576 * Returns the list of fields that can be imported
578 * @param bool $prefix
582 public static function &import($prefix = FALSE) {
583 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'report_instance', $prefix, []);
588 * Returns the list of fields that can be exported
590 * @param bool $prefix
594 public static function &export($prefix = FALSE) {
595 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'report_instance', $prefix, []);
600 * Returns the list of indices
602 * @param bool $localize
606 public static function indices($localize = TRUE) {
608 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;