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:b606b176882bfe116c788cba40258b8a)
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 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Which Domain is this instance for
46 * Report Instance Title.
53 * FK to civicrm_option_value for the report template
60 * when combined with report_id/template uniquely identifies the instance
67 * arguments that are passed in the url when invoking the instance
74 * Report Instance description.
81 * permission required to be able to run this instance
88 * role required to be able to run this instance
95 * Submitted form values for this report
102 * Is this entry active?
109 * FK to contact table.
116 * FK to contact table.
127 public $email_subject;
130 * comma-separated list of email addresses to send the report to
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 * FK to navigation ID
162 public $navigation_id;
165 * FK to instance ID drilldown to
169 public $drilldown_id;
179 public function __construct() {
180 $this->__table
= 'civicrm_report_instance';
181 parent
::__construct();
185 * Returns foreign keys and entity references.
188 * [CRM_Core_Reference_Interface]
190 public static function getReferenceColumns() {
191 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
192 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
193 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
194 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
195 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'owner_id', 'civicrm_contact', 'id');
196 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'navigation_id', 'civicrm_navigation', 'id');
197 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'drilldown_id', 'civicrm_report_instance', 'id');
198 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
200 return Civi
::$statics[__CLASS__
]['links'];
204 * Returns all the column names of this table
208 public static function &fields() {
209 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
210 Civi
::$statics[__CLASS__
]['fields'] = [
213 'type' => CRM_Utils_Type
::T_INT
,
214 'title' => ts('Report Instance ID'),
215 'description' => ts('Report Instance ID'),
217 'where' => 'civicrm_report_instance.id',
218 'table_name' => 'civicrm_report_instance',
219 'entity' => 'ReportInstance',
220 'bao' => 'CRM_Report_BAO_ReportInstance',
224 'name' => 'domain_id',
225 'type' => CRM_Utils_Type
::T_INT
,
226 'title' => ts('Report Instance Domain ID'),
227 'description' => ts('Which Domain is this instance for'),
229 'where' => 'civicrm_report_instance.domain_id',
230 'table_name' => 'civicrm_report_instance',
231 'entity' => 'ReportInstance',
232 'bao' => 'CRM_Report_BAO_ReportInstance',
234 'FKClassName' => 'CRM_Core_DAO_Domain',
235 'pseudoconstant' => [
236 'table' => 'civicrm_domain',
238 'labelColumn' => 'name',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('Report Instance Title'),
245 'description' => ts('Report Instance Title.'),
247 'size' => CRM_Utils_Type
::HUGE
,
248 'where' => 'civicrm_report_instance.title',
249 'table_name' => 'civicrm_report_instance',
250 'entity' => 'ReportInstance',
251 'bao' => 'CRM_Report_BAO_ReportInstance',
258 'name' => 'report_id',
259 'type' => CRM_Utils_Type
::T_STRING
,
260 'title' => ts('Report template ID'),
261 'description' => ts('FK to civicrm_option_value for the report template'),
264 'size' => CRM_Utils_Type
::HUGE
,
265 'where' => 'civicrm_report_instance.report_id',
266 'table_name' => 'civicrm_report_instance',
267 'entity' => 'ReportInstance',
268 'bao' => 'CRM_Report_BAO_ReportInstance',
276 'type' => CRM_Utils_Type
::T_STRING
,
277 'title' => ts('Report instance Name'),
278 'description' => ts('when combined with report_id/template uniquely identifies the instance'),
280 'size' => CRM_Utils_Type
::HUGE
,
281 'where' => 'civicrm_report_instance.name',
282 'table_name' => 'civicrm_report_instance',
283 'entity' => 'ReportInstance',
284 'bao' => 'CRM_Report_BAO_ReportInstance',
292 'type' => CRM_Utils_Type
::T_STRING
,
293 'title' => ts('Report Instance Arguments'),
294 'description' => ts('arguments that are passed in the url when invoking the instance'),
296 'size' => CRM_Utils_Type
::HUGE
,
297 'where' => 'civicrm_report_instance.args',
298 'table_name' => 'civicrm_report_instance',
299 'entity' => 'ReportInstance',
300 'bao' => 'CRM_Report_BAO_ReportInstance',
307 'name' => 'description',
308 'type' => CRM_Utils_Type
::T_STRING
,
309 'title' => ts('Report Instance description'),
310 'description' => ts('Report Instance description.'),
312 'size' => CRM_Utils_Type
::HUGE
,
313 'where' => 'civicrm_report_instance.description',
314 'table_name' => 'civicrm_report_instance',
315 'entity' => 'ReportInstance',
316 'bao' => 'CRM_Report_BAO_ReportInstance',
323 'name' => 'permission',
324 'type' => CRM_Utils_Type
::T_STRING
,
325 'title' => ts('Report Instance Permissions'),
326 'description' => ts('permission required to be able to run this instance'),
328 'size' => CRM_Utils_Type
::HUGE
,
329 'where' => 'civicrm_report_instance.permission',
330 'table_name' => 'civicrm_report_instance',
331 'entity' => 'ReportInstance',
332 'bao' => 'CRM_Report_BAO_ReportInstance',
339 'name' => 'grouprole',
340 'type' => CRM_Utils_Type
::T_STRING
,
341 'title' => ts('Report Instance Assigned to Roles'),
342 'description' => ts('role required to be able to run this instance'),
344 'size' => CRM_Utils_Type
::HUGE
,
345 'where' => 'civicrm_report_instance.grouprole',
346 'table_name' => 'civicrm_report_instance',
347 'entity' => 'ReportInstance',
348 'bao' => 'CRM_Report_BAO_ReportInstance',
355 'name' => 'form_values',
356 'type' => CRM_Utils_Type
::T_LONGTEXT
,
357 'title' => ts('Submitted Form Values'),
358 'description' => ts('Submitted form values for this report'),
360 'where' => 'civicrm_report_instance.form_values',
362 'table_name' => 'civicrm_report_instance',
363 'entity' => 'ReportInstance',
364 'bao' => 'CRM_Report_BAO_ReportInstance',
366 'serialize' => self
::SERIALIZE_PHP
,
369 'name' => 'is_active',
370 'type' => CRM_Utils_Type
::T_BOOLEAN
,
371 'title' => ts('Report Instance is Active'),
372 'description' => ts('Is this entry active?'),
373 'where' => 'civicrm_report_instance.is_active',
374 'table_name' => 'civicrm_report_instance',
375 'entity' => 'ReportInstance',
376 'bao' => 'CRM_Report_BAO_ReportInstance',
379 'type' => 'CheckBox',
383 'name' => 'created_id',
384 'type' => CRM_Utils_Type
::T_INT
,
385 'title' => ts('Report Instance Created By'),
386 'description' => ts('FK to contact table.'),
387 'where' => 'civicrm_report_instance.created_id',
388 'table_name' => 'civicrm_report_instance',
389 'entity' => 'ReportInstance',
390 'bao' => 'CRM_Report_BAO_ReportInstance',
392 'FKClassName' => 'CRM_Contact_DAO_Contact',
395 'name' => 'owner_id',
396 'type' => CRM_Utils_Type
::T_INT
,
397 'title' => ts('Report Instance Owned By'),
398 'description' => ts('FK to contact table.'),
399 'where' => 'civicrm_report_instance.owner_id',
400 'table_name' => 'civicrm_report_instance',
401 'entity' => 'ReportInstance',
402 'bao' => 'CRM_Report_BAO_ReportInstance',
404 'FKClassName' => 'CRM_Contact_DAO_Contact',
407 'name' => 'email_subject',
408 'type' => CRM_Utils_Type
::T_STRING
,
409 'title' => ts('Report Instance email Subject'),
410 'description' => ts('Subject of email'),
412 'size' => CRM_Utils_Type
::HUGE
,
413 'where' => 'civicrm_report_instance.email_subject',
414 'table_name' => 'civicrm_report_instance',
415 'entity' => 'ReportInstance',
416 'bao' => 'CRM_Report_BAO_ReportInstance',
423 'name' => 'email_to',
424 'type' => CRM_Utils_Type
::T_TEXT
,
425 'title' => ts('Email Report Instance To'),
426 'description' => ts('comma-separated list of email addresses to send the report to'),
427 'where' => 'civicrm_report_instance.email_to',
428 'table_name' => 'civicrm_report_instance',
429 'entity' => 'ReportInstance',
430 'bao' => 'CRM_Report_BAO_ReportInstance',
437 'name' => 'email_cc',
438 'type' => CRM_Utils_Type
::T_TEXT
,
439 'title' => ts('cc Email Report Instance To'),
440 'description' => ts('comma-separated list of email addresses to send the report to'),
441 'where' => 'civicrm_report_instance.email_cc',
442 'table_name' => 'civicrm_report_instance',
443 'entity' => 'ReportInstance',
444 'bao' => 'CRM_Report_BAO_ReportInstance',
452 'type' => CRM_Utils_Type
::T_TEXT
,
453 'title' => ts('Report Instance Header'),
454 'description' => ts('comma-separated list of email addresses to send the report to'),
457 'where' => 'civicrm_report_instance.header',
458 'table_name' => 'civicrm_report_instance',
459 'entity' => 'ReportInstance',
460 'bao' => 'CRM_Report_BAO_ReportInstance',
463 'type' => 'TextArea',
468 'type' => CRM_Utils_Type
::T_TEXT
,
469 'title' => ts('Report Instance Footer'),
470 'description' => ts('comma-separated list of email addresses to send the report to'),
473 'where' => 'civicrm_report_instance.footer',
474 'table_name' => 'civicrm_report_instance',
475 'entity' => 'ReportInstance',
476 'bao' => 'CRM_Report_BAO_ReportInstance',
479 'type' => 'TextArea',
483 'name' => 'navigation_id',
484 'type' => CRM_Utils_Type
::T_INT
,
485 'title' => ts('Navigation ID'),
486 'description' => ts('FK to navigation ID'),
488 'where' => 'civicrm_report_instance.navigation_id',
490 'table_name' => 'civicrm_report_instance',
491 'entity' => 'ReportInstance',
492 'bao' => 'CRM_Report_BAO_ReportInstance',
494 'FKClassName' => 'CRM_Core_DAO_Navigation',
497 'name' => 'drilldown_id',
498 'type' => CRM_Utils_Type
::T_INT
,
499 'title' => ts('Drilldown Report ID'),
500 'description' => ts('FK to instance ID drilldown to'),
502 'where' => 'civicrm_report_instance.drilldown_id',
504 'table_name' => 'civicrm_report_instance',
505 'entity' => 'ReportInstance',
506 'bao' => 'CRM_Report_BAO_ReportInstance',
508 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
511 'name' => 'is_reserved',
512 'type' => CRM_Utils_Type
::T_BOOLEAN
,
513 'title' => ts('Instance is Reserved'),
514 'where' => 'civicrm_report_instance.is_reserved',
516 'table_name' => 'civicrm_report_instance',
517 'entity' => 'ReportInstance',
518 'bao' => 'CRM_Report_BAO_ReportInstance',
521 'type' => 'CheckBox',
525 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
527 return Civi
::$statics[__CLASS__
]['fields'];
531 * Return a mapping from field-name to the corresponding key (as used in fields()).
534 * Array(string $name => string $uniqueName).
536 public static function &fieldKeys() {
537 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
538 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
540 return Civi
::$statics[__CLASS__
]['fieldKeys'];
544 * Returns the names of this table
548 public static function getTableName() {
549 return self
::$_tableName;
553 * Returns if this table needs to be logged
557 public function getLog() {
562 * Returns the list of fields that can be imported
564 * @param bool $prefix
568 public static function &import($prefix = FALSE) {
569 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'report_instance', $prefix, []);
574 * Returns the list of fields that can be exported
576 * @param bool $prefix
580 public static function &export($prefix = FALSE) {
581 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'report_instance', $prefix, []);
586 * Returns the list of indices
588 * @param bool $localize
592 public static function indices($localize = TRUE) {
594 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;