5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Report/ReportInstance.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:09ffdd1693f38f5790d4c9c00d3c5d2f)
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 static $_tableName = 'civicrm_report_instance';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'Report Instance ID',
217 'table_name' => 'civicrm_report_instance',
218 'entity' => 'ReportInstance',
219 'bao' => 'CRM_Report_BAO_ReportInstance',
223 'name' => 'domain_id',
224 'type' => CRM_Utils_Type
::T_INT
,
225 'title' => ts('Report Instance Domain ID'),
226 'description' => 'Which Domain is this instance for',
228 'table_name' => 'civicrm_report_instance',
229 'entity' => 'ReportInstance',
230 'bao' => 'CRM_Report_BAO_ReportInstance',
232 'FKClassName' => 'CRM_Core_DAO_Domain',
233 'pseudoconstant' => [
234 'table' => 'civicrm_domain',
236 'labelColumn' => 'name',
241 'type' => CRM_Utils_Type
::T_STRING
,
242 'title' => ts('Report Instance Title'),
243 'description' => 'Report Instance Title.',
245 'size' => CRM_Utils_Type
::HUGE
,
246 'table_name' => 'civicrm_report_instance',
247 'entity' => 'ReportInstance',
248 'bao' => 'CRM_Report_BAO_ReportInstance',
255 'name' => 'report_id',
256 'type' => CRM_Utils_Type
::T_STRING
,
257 'title' => ts('Report template ID'),
258 'description' => 'FK to civicrm_option_value for the report template',
261 'size' => CRM_Utils_Type
::HUGE
,
262 'table_name' => 'civicrm_report_instance',
263 'entity' => 'ReportInstance',
264 'bao' => 'CRM_Report_BAO_ReportInstance',
272 'type' => CRM_Utils_Type
::T_STRING
,
273 'title' => ts('Report instance Name'),
274 'description' => 'when combined with report_id/template uniquely identifies the instance',
276 'size' => CRM_Utils_Type
::HUGE
,
277 'table_name' => 'civicrm_report_instance',
278 'entity' => 'ReportInstance',
279 'bao' => 'CRM_Report_BAO_ReportInstance',
287 'type' => CRM_Utils_Type
::T_STRING
,
288 'title' => ts('Report Instance Arguments'),
289 'description' => 'arguments that are passed in the url when invoking the instance',
291 'size' => CRM_Utils_Type
::HUGE
,
292 'table_name' => 'civicrm_report_instance',
293 'entity' => 'ReportInstance',
294 'bao' => 'CRM_Report_BAO_ReportInstance',
301 'name' => 'description',
302 'type' => CRM_Utils_Type
::T_STRING
,
303 'title' => ts('Report Instance description'),
304 'description' => 'Report Instance description.',
306 'size' => CRM_Utils_Type
::HUGE
,
307 'table_name' => 'civicrm_report_instance',
308 'entity' => 'ReportInstance',
309 'bao' => 'CRM_Report_BAO_ReportInstance',
316 'name' => 'permission',
317 'type' => CRM_Utils_Type
::T_STRING
,
318 'title' => ts('Report Instance Permissions'),
319 'description' => 'permission required to be able to run this instance',
321 'size' => CRM_Utils_Type
::HUGE
,
322 'table_name' => 'civicrm_report_instance',
323 'entity' => 'ReportInstance',
324 'bao' => 'CRM_Report_BAO_ReportInstance',
331 'name' => 'grouprole',
332 'type' => CRM_Utils_Type
::T_STRING
,
333 'title' => ts('Report Instance Assigned to Roles'),
334 'description' => 'role required to be able to run this instance',
336 'size' => CRM_Utils_Type
::HUGE
,
337 'table_name' => 'civicrm_report_instance',
338 'entity' => 'ReportInstance',
339 'bao' => 'CRM_Report_BAO_ReportInstance',
346 'name' => 'form_values',
347 'type' => CRM_Utils_Type
::T_TEXT
,
348 'title' => ts('Submitted Form Values'),
349 'description' => 'Submitted form values for this report',
351 'where' => 'civicrm_report_instance.form_values',
352 'headerPattern' => '',
355 'table_name' => 'civicrm_report_instance',
356 'entity' => 'ReportInstance',
357 'bao' => 'CRM_Report_BAO_ReportInstance',
359 'serialize' => self
::SERIALIZE_PHP
,
362 'name' => 'is_active',
363 'type' => CRM_Utils_Type
::T_BOOLEAN
,
364 'title' => ts('Report Instance is Active'),
365 'description' => 'Is this entry active?',
366 'table_name' => 'civicrm_report_instance',
367 'entity' => 'ReportInstance',
368 'bao' => 'CRM_Report_BAO_ReportInstance',
371 'type' => 'CheckBox',
375 'name' => 'created_id',
376 'type' => CRM_Utils_Type
::T_INT
,
377 'title' => ts('Report Instance Created By'),
378 'description' => 'FK to contact table.',
379 'table_name' => 'civicrm_report_instance',
380 'entity' => 'ReportInstance',
381 'bao' => 'CRM_Report_BAO_ReportInstance',
383 'FKClassName' => 'CRM_Contact_DAO_Contact',
386 'name' => 'owner_id',
387 'type' => CRM_Utils_Type
::T_INT
,
388 'title' => ts('Report Instance Owned By'),
389 'description' => 'FK to contact table.',
390 'table_name' => 'civicrm_report_instance',
391 'entity' => 'ReportInstance',
392 'bao' => 'CRM_Report_BAO_ReportInstance',
394 'FKClassName' => 'CRM_Contact_DAO_Contact',
397 'name' => 'email_subject',
398 'type' => CRM_Utils_Type
::T_STRING
,
399 'title' => ts('Report Instance email Subject'),
400 'description' => 'Subject of email',
402 'size' => CRM_Utils_Type
::HUGE
,
403 'table_name' => 'civicrm_report_instance',
404 'entity' => 'ReportInstance',
405 'bao' => 'CRM_Report_BAO_ReportInstance',
412 'name' => 'email_to',
413 'type' => CRM_Utils_Type
::T_TEXT
,
414 'title' => ts('Email Report Instance To'),
415 'description' => 'comma-separated list of email addresses to send the report to',
416 'table_name' => 'civicrm_report_instance',
417 'entity' => 'ReportInstance',
418 'bao' => 'CRM_Report_BAO_ReportInstance',
425 'name' => 'email_cc',
426 'type' => CRM_Utils_Type
::T_TEXT
,
427 'title' => ts('cc Email Report Instance To'),
428 'description' => 'comma-separated list of email addresses to send the report to',
429 'table_name' => 'civicrm_report_instance',
430 'entity' => 'ReportInstance',
431 'bao' => 'CRM_Report_BAO_ReportInstance',
439 'type' => CRM_Utils_Type
::T_TEXT
,
440 'title' => ts('Report Instance Header'),
441 'description' => 'comma-separated list of email addresses to send the report to',
444 'table_name' => 'civicrm_report_instance',
445 'entity' => 'ReportInstance',
446 'bao' => 'CRM_Report_BAO_ReportInstance',
449 'type' => 'TextArea',
454 'type' => CRM_Utils_Type
::T_TEXT
,
455 'title' => ts('Report Instance Footer'),
456 'description' => 'comma-separated list of email addresses to send the report to',
459 'table_name' => 'civicrm_report_instance',
460 'entity' => 'ReportInstance',
461 'bao' => 'CRM_Report_BAO_ReportInstance',
464 'type' => 'TextArea',
468 'name' => 'navigation_id',
469 'type' => CRM_Utils_Type
::T_INT
,
470 'title' => ts('Navigation ID'),
471 'description' => 'FK to navigation ID',
473 'where' => 'civicrm_report_instance.navigation_id',
474 'headerPattern' => '',
477 'table_name' => 'civicrm_report_instance',
478 'entity' => 'ReportInstance',
479 'bao' => 'CRM_Report_BAO_ReportInstance',
481 'FKClassName' => 'CRM_Core_DAO_Navigation',
484 'name' => 'drilldown_id',
485 'type' => CRM_Utils_Type
::T_INT
,
486 'title' => ts('Drilldown Report ID'),
487 'description' => 'FK to instance ID drilldown to',
489 'where' => 'civicrm_report_instance.drilldown_id',
490 'headerPattern' => '',
493 'table_name' => 'civicrm_report_instance',
494 'entity' => 'ReportInstance',
495 'bao' => 'CRM_Report_BAO_ReportInstance',
497 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
500 'name' => 'is_reserved',
501 'type' => CRM_Utils_Type
::T_BOOLEAN
,
502 'title' => ts('Instance is Reserved'),
503 'table_name' => 'civicrm_report_instance',
504 'entity' => 'ReportInstance',
505 'bao' => 'CRM_Report_BAO_ReportInstance',
508 'type' => 'CheckBox',
512 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
514 return Civi
::$statics[__CLASS__
]['fields'];
518 * Return a mapping from field-name to the corresponding key (as used in fields()).
521 * Array(string $name => string $uniqueName).
523 public static function &fieldKeys() {
524 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
525 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
527 return Civi
::$statics[__CLASS__
]['fieldKeys'];
531 * Returns the names of this table
535 public static function getTableName() {
536 return self
::$_tableName;
540 * Returns if this table needs to be logged
544 public function getLog() {
549 * Returns the list of fields that can be imported
551 * @param bool $prefix
555 public static function &import($prefix = FALSE) {
556 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'report_instance', $prefix, []);
561 * Returns the list of fields that can be exported
563 * @param bool $prefix
567 public static function &export($prefix = FALSE) {
568 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'report_instance', $prefix, []);
573 * Returns the list of indices
575 * @param bool $localize
579 public static function indices($localize = TRUE) {
581 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;