More phpdoc fixes, this time related to report form methods
[civicrm-core.git] / CRM / Report / DAO / ReportInstance.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
ca5cec67 5 * @copyright CiviCRM LLC https://civicrm.org/licensing
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Report/ReportInstance.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
2562d09a 9 * (GenCodeChecksum:8119de0836afac038bfa8eeed2c0fb63)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the ReportInstance entity.
f41f0342 14 */
e501603b 15class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO {
929a1c14
CW
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '2.2';
d31fb4e3 18 const COMPONENT = 'CiviReport';
c3fc2621 19
e501603b 20 /**
f41f0342 21 * Static instance to hold the table name.
e501603b
TO
22 *
23 * @var string
24 */
fa45b5b9 25 public static $_tableName = 'civicrm_report_instance';
c3fc2621 26
449c4e6b
CW
27 /**
28 * Icon associated with this entity.
29 *
30 * @var string
31 */
32 public static $_icon = 'fa-bar-chart';
33
e501603b 34 /**
f41f0342 35 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 36 *
c3fc2621 37 * @var bool
e501603b 38 */
fa45b5b9 39 public static $_log = FALSE;
c3fc2621 40
e501603b
TO
41 /**
42 * Report Instance ID
43 *
e6ca0a57 44 * @var int
e501603b
TO
45 */
46 public $id;
c3fc2621 47
e501603b
TO
48 /**
49 * Which Domain is this instance for
50 *
e6ca0a57 51 * @var int
e501603b
TO
52 */
53 public $domain_id;
c3fc2621 54
e501603b
TO
55 /**
56 * Report Instance Title.
57 *
58 * @var string
59 */
60 public $title;
c3fc2621 61
e501603b
TO
62 /**
63 * FK to civicrm_option_value for the report template
64 *
65 * @var string
66 */
67 public $report_id;
c3fc2621 68
e501603b
TO
69 /**
70 * when combined with report_id/template uniquely identifies the instance
71 *
72 * @var string
73 */
74 public $name;
c3fc2621 75
e501603b
TO
76 /**
77 * arguments that are passed in the url when invoking the instance
78 *
79 * @var string
80 */
81 public $args;
c3fc2621 82
e501603b
TO
83 /**
84 * Report Instance description.
85 *
86 * @var string
87 */
88 public $description;
c3fc2621 89
e501603b
TO
90 /**
91 * permission required to be able to run this instance
92 *
93 * @var string
94 */
95 public $permission;
c3fc2621 96
e501603b
TO
97 /**
98 * role required to be able to run this instance
99 *
100 * @var string
101 */
102 public $grouprole;
c3fc2621 103
e501603b
TO
104 /**
105 * Submitted form values for this report
106 *
b31aa78e 107 * @var longtext
e501603b
TO
108 */
109 public $form_values;
c3fc2621 110
e501603b
TO
111 /**
112 * Is this entry active?
113 *
e6ca0a57 114 * @var bool
e501603b
TO
115 */
116 public $is_active;
c3fc2621 117
e501603b
TO
118 /**
119 * FK to contact table.
120 *
e6ca0a57 121 * @var int
e501603b
TO
122 */
123 public $created_id;
c3fc2621 124
e501603b
TO
125 /**
126 * FK to contact table.
127 *
e6ca0a57 128 * @var int
e501603b
TO
129 */
130 public $owner_id;
c3fc2621 131
e501603b
TO
132 /**
133 * Subject of email
134 *
135 * @var string
136 */
137 public $email_subject;
c3fc2621 138
e501603b
TO
139 /**
140 * comma-separated list of email addresses to send the report to
141 *
142 * @var text
143 */
144 public $email_to;
c3fc2621 145
e501603b
TO
146 /**
147 * comma-separated list of email addresses to send the report to
148 *
149 * @var text
150 */
151 public $email_cc;
c3fc2621 152
e501603b
TO
153 /**
154 * comma-separated list of email addresses to send the report to
155 *
156 * @var text
157 */
158 public $header;
c3fc2621 159
e501603b
TO
160 /**
161 * comma-separated list of email addresses to send the report to
162 *
163 * @var text
164 */
165 public $footer;
c3fc2621 166
e501603b
TO
167 /**
168 * FK to navigation ID
169 *
e6ca0a57 170 * @var int
e501603b
TO
171 */
172 public $navigation_id;
c3fc2621 173
e501603b
TO
174 /**
175 * FK to instance ID drilldown to
176 *
e6ca0a57 177 * @var int
e501603b
TO
178 */
179 public $drilldown_id;
c3fc2621 180
e501603b 181 /**
e6ca0a57 182 * @var bool
e501603b
TO
183 */
184 public $is_reserved;
c3fc2621 185
e501603b 186 /**
f41f0342 187 * Class constructor.
e501603b 188 */
c3fc2621 189 public function __construct() {
e501603b
TO
190 $this->__table = 'civicrm_report_instance';
191 parent::__construct();
192 }
c3fc2621 193
e501603b 194 /**
449c4e6b 195 * Returns localized title of this entity.
7b66c3b5
AH
196 *
197 * @param bool $plural
198 * Whether to return the plural version of the title.
449c4e6b 199 */
7b66c3b5
AH
200 public static function getEntityTitle($plural = FALSE) {
201 return $plural ? ts('Reports') : ts('Report');
449c4e6b
CW
202 }
203
204 /**
f41f0342 205 * Returns foreign keys and entity references.
e501603b
TO
206 *
207 * @return array
208 * [CRM_Core_Reference_Interface]
209 */
c3fc2621 210 public static function getReferenceColumns() {
346aaaba 211 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 212 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621
CW
213 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
214 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
215 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'owner_id', 'civicrm_contact', 'id');
216 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'navigation_id', 'civicrm_navigation', 'id');
217 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'drilldown_id', 'civicrm_report_instance', 'id');
346aaaba 218 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 219 }
346aaaba 220 return Civi::$statics[__CLASS__]['links'];
e501603b 221 }
c3fc2621 222
e501603b
TO
223 /**
224 * Returns all the column names of this table
225 *
226 * @return array
227 */
c3fc2621 228 public static function &fields() {
346aaaba 229 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
230 Civi::$statics[__CLASS__]['fields'] = [
231 'id' => [
e501603b
TO
232 'name' => 'id',
233 'type' => CRM_Utils_Type::T_INT,
c3fc2621 234 'title' => ts('Report Instance ID'),
215b423e 235 'description' => ts('Report Instance ID'),
c3fc2621 236 'required' => TRUE,
a36434b9 237 'where' => 'civicrm_report_instance.id',
522a26c9 238 'table_name' => 'civicrm_report_instance',
239 'entity' => 'ReportInstance',
240 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 241 'localizable' => 0,
2cbbebe8
A
242 'html' => [
243 'type' => 'Number',
244 ],
1fe423d6 245 'readonly' => TRUE,
a9d0587b 246 'add' => '2.2',
c3fc2621
CW
247 ],
248 'domain_id' => [
e501603b
TO
249 'name' => 'domain_id',
250 'type' => CRM_Utils_Type::T_INT,
2cbbebe8 251 'title' => ts('Domain ID'),
215b423e 252 'description' => ts('Which Domain is this instance for'),
c3fc2621 253 'required' => TRUE,
a36434b9 254 'where' => 'civicrm_report_instance.domain_id',
522a26c9 255 'table_name' => 'civicrm_report_instance',
256 'entity' => 'ReportInstance',
257 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 258 'localizable' => 0,
e501603b 259 'FKClassName' => 'CRM_Core_DAO_Domain',
2cbbebe8
A
260 'html' => [
261 'label' => ts("Domain"),
262 ],
c3fc2621 263 'pseudoconstant' => [
e501603b
TO
264 'table' => 'civicrm_domain',
265 'keyColumn' => 'id',
266 'labelColumn' => 'name',
e6ca0a57 267 ],
a9d0587b 268 'add' => '3.1',
c3fc2621
CW
269 ],
270 'title' => [
e501603b
TO
271 'name' => 'title',
272 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 273 'title' => ts('Report Instance Title'),
215b423e 274 'description' => ts('Report Instance Title.'),
e501603b
TO
275 'maxlength' => 255,
276 'size' => CRM_Utils_Type::HUGE,
a36434b9 277 'where' => 'civicrm_report_instance.title',
522a26c9 278 'table_name' => 'civicrm_report_instance',
279 'entity' => 'ReportInstance',
280 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 281 'localizable' => 0,
c3fc2621 282 'html' => [
e501603b 283 'type' => 'Text',
c3fc2621 284 ],
a9d0587b 285 'add' => '2.2',
c3fc2621
CW
286 ],
287 'report_id' => [
e501603b
TO
288 'name' => 'report_id',
289 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 290 'title' => ts('Report template ID'),
215b423e 291 'description' => ts('FK to civicrm_option_value for the report template'),
c3fc2621 292 'required' => TRUE,
1435405e
SL
293 'maxlength' => 512,
294 'size' => CRM_Utils_Type::HUGE,
a36434b9 295 'where' => 'civicrm_report_instance.report_id',
522a26c9 296 'table_name' => 'civicrm_report_instance',
297 'entity' => 'ReportInstance',
298 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 299 'localizable' => 0,
c3fc2621 300 'html' => [
e501603b 301 'type' => 'Select',
c3fc2621 302 ],
a9d0587b 303 'add' => '2.2',
c3fc2621
CW
304 ],
305 'name' => [
e501603b
TO
306 'name' => 'name',
307 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 308 'title' => ts('Report instance Name'),
215b423e 309 'description' => ts('when combined with report_id/template uniquely identifies the instance'),
e501603b
TO
310 'maxlength' => 255,
311 'size' => CRM_Utils_Type::HUGE,
a36434b9 312 'where' => 'civicrm_report_instance.name',
522a26c9 313 'table_name' => 'civicrm_report_instance',
314 'entity' => 'ReportInstance',
315 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 316 'localizable' => 0,
c3fc2621 317 'html' => [
e501603b 318 'type' => 'Text',
c3fc2621 319 ],
a9d0587b 320 'add' => '3.2',
c3fc2621
CW
321 ],
322 'args' => [
e501603b
TO
323 'name' => 'args',
324 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 325 'title' => ts('Report Instance Arguments'),
215b423e 326 'description' => ts('arguments that are passed in the url when invoking the instance'),
e501603b
TO
327 'maxlength' => 255,
328 'size' => CRM_Utils_Type::HUGE,
a36434b9 329 'where' => 'civicrm_report_instance.args',
522a26c9 330 'table_name' => 'civicrm_report_instance',
331 'entity' => 'ReportInstance',
332 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 333 'localizable' => 0,
c3fc2621 334 'html' => [
e501603b 335 'type' => 'Text',
c3fc2621 336 ],
a9d0587b 337 'add' => '3.2',
c3fc2621
CW
338 ],
339 'description' => [
e501603b
TO
340 'name' => 'description',
341 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 342 'title' => ts('Report Instance description'),
215b423e 343 'description' => ts('Report Instance description.'),
e501603b
TO
344 'maxlength' => 255,
345 'size' => CRM_Utils_Type::HUGE,
a36434b9 346 'where' => 'civicrm_report_instance.description',
522a26c9 347 'table_name' => 'civicrm_report_instance',
348 'entity' => 'ReportInstance',
349 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 350 'localizable' => 0,
c3fc2621 351 'html' => [
e501603b 352 'type' => 'Text',
c3fc2621 353 ],
a9d0587b 354 'add' => '2.2',
c3fc2621
CW
355 ],
356 'permission' => [
e501603b
TO
357 'name' => 'permission',
358 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 359 'title' => ts('Report Instance Permissions'),
215b423e 360 'description' => ts('permission required to be able to run this instance'),
e501603b
TO
361 'maxlength' => 255,
362 'size' => CRM_Utils_Type::HUGE,
a36434b9 363 'where' => 'civicrm_report_instance.permission',
522a26c9 364 'table_name' => 'civicrm_report_instance',
365 'entity' => 'ReportInstance',
366 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 367 'localizable' => 0,
c3fc2621 368 'html' => [
e501603b 369 'type' => 'Text',
c3fc2621 370 ],
a9d0587b 371 'add' => '2.2',
c3fc2621
CW
372 ],
373 'grouprole' => [
e501603b
TO
374 'name' => 'grouprole',
375 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 376 'title' => ts('Report Instance Assigned to Roles'),
215b423e 377 'description' => ts('role required to be able to run this instance'),
e501603b
TO
378 'maxlength' => 1024,
379 'size' => CRM_Utils_Type::HUGE,
a36434b9 380 'where' => 'civicrm_report_instance.grouprole',
522a26c9 381 'table_name' => 'civicrm_report_instance',
382 'entity' => 'ReportInstance',
383 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 384 'localizable' => 0,
c3fc2621 385 'html' => [
e501603b 386 'type' => 'Text',
c3fc2621 387 ],
a9d0587b 388 'add' => '4.1',
c3fc2621
CW
389 ],
390 'form_values' => [
e501603b 391 'name' => 'form_values',
b31aa78e 392 'type' => CRM_Utils_Type::T_LONGTEXT,
c3fc2621 393 'title' => ts('Submitted Form Values'),
215b423e 394 'description' => ts('Submitted form values for this report'),
c3fc2621 395 'import' => TRUE,
e501603b 396 'where' => 'civicrm_report_instance.form_values',
c3fc2621 397 'export' => TRUE,
522a26c9 398 'table_name' => 'civicrm_report_instance',
399 'entity' => 'ReportInstance',
400 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 401 'localizable' => 0,
2a5c9b4d 402 'serialize' => self::SERIALIZE_PHP,
a9d0587b 403 'add' => '2.2',
c3fc2621
CW
404 ],
405 'is_active' => [
e501603b
TO
406 'name' => 'is_active',
407 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 408 'title' => ts('Report Instance is Active'),
215b423e 409 'description' => ts('Is this entry active?'),
a36434b9 410 'where' => 'civicrm_report_instance.is_active',
522a26c9 411 'table_name' => 'civicrm_report_instance',
412 'entity' => 'ReportInstance',
413 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 414 'localizable' => 0,
c3fc2621 415 'html' => [
e501603b 416 'type' => 'CheckBox',
c3fc2621 417 ],
a9d0587b 418 'add' => '2.2',
c3fc2621
CW
419 ],
420 'created_id' => [
e501603b
TO
421 'name' => 'created_id',
422 'type' => CRM_Utils_Type::T_INT,
2cbbebe8 423 'title' => ts('Created By Contact ID'),
215b423e 424 'description' => ts('FK to contact table.'),
a36434b9 425 'where' => 'civicrm_report_instance.created_id',
522a26c9 426 'table_name' => 'civicrm_report_instance',
427 'entity' => 'ReportInstance',
428 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 429 'localizable' => 0,
e501603b 430 'FKClassName' => 'CRM_Contact_DAO_Contact',
2cbbebe8
A
431 'html' => [
432 'label' => ts("Created By"),
433 ],
a9d0587b 434 'add' => '4.6',
c3fc2621
CW
435 ],
436 'owner_id' => [
e501603b
TO
437 'name' => 'owner_id',
438 'type' => CRM_Utils_Type::T_INT,
2cbbebe8 439 'title' => ts('Owned By Contact ID'),
215b423e 440 'description' => ts('FK to contact table.'),
a36434b9 441 'where' => 'civicrm_report_instance.owner_id',
522a26c9 442 'table_name' => 'civicrm_report_instance',
443 'entity' => 'ReportInstance',
444 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 445 'localizable' => 0,
e501603b 446 'FKClassName' => 'CRM_Contact_DAO_Contact',
2cbbebe8
A
447 'html' => [
448 'label' => ts("Owned By"),
449 ],
a9d0587b 450 'add' => '4.6',
c3fc2621
CW
451 ],
452 'email_subject' => [
e501603b
TO
453 'name' => 'email_subject',
454 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 455 'title' => ts('Report Instance email Subject'),
215b423e 456 'description' => ts('Subject of email'),
e501603b
TO
457 'maxlength' => 255,
458 'size' => CRM_Utils_Type::HUGE,
a36434b9 459 'where' => 'civicrm_report_instance.email_subject',
522a26c9 460 'table_name' => 'civicrm_report_instance',
461 'entity' => 'ReportInstance',
462 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 463 'localizable' => 0,
c3fc2621 464 'html' => [
e501603b 465 'type' => 'Text',
c3fc2621 466 ],
a9d0587b 467 'add' => NULL,
c3fc2621
CW
468 ],
469 'email_to' => [
e501603b
TO
470 'name' => 'email_to',
471 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 472 'title' => ts('Email Report Instance To'),
215b423e 473 'description' => ts('comma-separated list of email addresses to send the report to'),
a36434b9 474 'where' => 'civicrm_report_instance.email_to',
522a26c9 475 'table_name' => 'civicrm_report_instance',
476 'entity' => 'ReportInstance',
477 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 478 'localizable' => 0,
c3fc2621 479 'html' => [
e501603b 480 'type' => 'Text',
c3fc2621 481 ],
a9d0587b 482 'add' => '2.2',
c3fc2621
CW
483 ],
484 'email_cc' => [
e501603b
TO
485 'name' => 'email_cc',
486 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 487 'title' => ts('cc Email Report Instance To'),
215b423e 488 'description' => ts('comma-separated list of email addresses to send the report to'),
a36434b9 489 'where' => 'civicrm_report_instance.email_cc',
522a26c9 490 'table_name' => 'civicrm_report_instance',
491 'entity' => 'ReportInstance',
492 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 493 'localizable' => 0,
c3fc2621 494 'html' => [
e501603b 495 'type' => 'Text',
c3fc2621 496 ],
a9d0587b 497 'add' => '2.2',
c3fc2621
CW
498 ],
499 'header' => [
e501603b
TO
500 'name' => 'header',
501 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 502 'title' => ts('Report Instance Header'),
215b423e 503 'description' => ts('comma-separated list of email addresses to send the report to'),
e501603b
TO
504 'rows' => 4,
505 'cols' => 60,
a36434b9 506 'where' => 'civicrm_report_instance.header',
522a26c9 507 'table_name' => 'civicrm_report_instance',
508 'entity' => 'ReportInstance',
509 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 510 'localizable' => 0,
c3fc2621 511 'html' => [
e501603b 512 'type' => 'TextArea',
c3fc2621 513 ],
a9d0587b 514 'add' => '2.2',
c3fc2621
CW
515 ],
516 'footer' => [
e501603b
TO
517 'name' => 'footer',
518 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 519 'title' => ts('Report Instance Footer'),
215b423e 520 'description' => ts('comma-separated list of email addresses to send the report to'),
e501603b
TO
521 'rows' => 4,
522 'cols' => 60,
a36434b9 523 'where' => 'civicrm_report_instance.footer',
522a26c9 524 'table_name' => 'civicrm_report_instance',
525 'entity' => 'ReportInstance',
526 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 527 'localizable' => 0,
c3fc2621 528 'html' => [
e501603b 529 'type' => 'TextArea',
c3fc2621 530 ],
a9d0587b 531 'add' => '2.2',
c3fc2621
CW
532 ],
533 'navigation_id' => [
e501603b
TO
534 'name' => 'navigation_id',
535 'type' => CRM_Utils_Type::T_INT,
c3fc2621 536 'title' => ts('Navigation ID'),
215b423e 537 'description' => ts('FK to navigation ID'),
c3fc2621 538 'import' => TRUE,
e501603b 539 'where' => 'civicrm_report_instance.navigation_id',
c3fc2621 540 'export' => TRUE,
522a26c9 541 'table_name' => 'civicrm_report_instance',
542 'entity' => 'ReportInstance',
543 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 544 'localizable' => 0,
e501603b 545 'FKClassName' => 'CRM_Core_DAO_Navigation',
2cbbebe8
A
546 'html' => [
547 'label' => ts("Navigation"),
548 ],
a9d0587b 549 'add' => '3.0',
c3fc2621
CW
550 ],
551 'drilldown_id' => [
e501603b
TO
552 'name' => 'drilldown_id',
553 'type' => CRM_Utils_Type::T_INT,
c3fc2621 554 'title' => ts('Drilldown Report ID'),
215b423e 555 'description' => ts('FK to instance ID drilldown to'),
c3fc2621 556 'import' => TRUE,
e501603b 557 'where' => 'civicrm_report_instance.drilldown_id',
c3fc2621 558 'export' => TRUE,
522a26c9 559 'table_name' => 'civicrm_report_instance',
560 'entity' => 'ReportInstance',
561 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 562 'localizable' => 0,
e501603b 563 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
2cbbebe8
A
564 'html' => [
565 'label' => ts("Drilldown Report"),
566 ],
a9d0587b 567 'add' => '4.3',
c3fc2621
CW
568 ],
569 'is_reserved' => [
e501603b
TO
570 'name' => 'is_reserved',
571 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 572 'title' => ts('Instance is Reserved'),
a36434b9 573 'where' => 'civicrm_report_instance.is_reserved',
45a83e42 574 'default' => '0',
522a26c9 575 'table_name' => 'civicrm_report_instance',
576 'entity' => 'ReportInstance',
577 'bao' => 'CRM_Report_BAO_ReportInstance',
6a7e5e5d 578 'localizable' => 0,
c3fc2621 579 'html' => [
e501603b 580 'type' => 'CheckBox',
c3fc2621 581 ],
a9d0587b 582 'add' => '4.2',
c3fc2621
CW
583 ],
584 ];
346aaaba 585 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 586 }
346aaaba 587 return Civi::$statics[__CLASS__]['fields'];
e501603b 588 }
c3fc2621 589
e501603b 590 /**
bd8e0b14 591 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
592 *
593 * @return array
bd8e0b14 594 * Array(string $name => string $uniqueName).
e501603b 595 */
c3fc2621 596 public static function &fieldKeys() {
bd8e0b14
TO
597 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
598 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 599 }
bd8e0b14 600 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 601 }
c3fc2621 602
e501603b
TO
603 /**
604 * Returns the names of this table
605 *
606 * @return string
607 */
c3fc2621 608 public static function getTableName() {
e501603b
TO
609 return self::$_tableName;
610 }
c3fc2621 611
e501603b
TO
612 /**
613 * Returns if this table needs to be logged
614 *
c3fc2621 615 * @return bool
e501603b 616 */
c3fc2621 617 public function getLog() {
e501603b
TO
618 return self::$_log;
619 }
c3fc2621 620
e501603b
TO
621 /**
622 * Returns the list of fields that can be imported
623 *
624 * @param bool $prefix
625 *
626 * @return array
627 */
c3fc2621
CW
628 public static function &import($prefix = FALSE) {
629 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'report_instance', $prefix, []);
60808919 630 return $r;
e501603b 631 }
c3fc2621 632
e501603b
TO
633 /**
634 * Returns the list of fields that can be exported
635 *
636 * @param bool $prefix
637 *
638 * @return array
639 */
c3fc2621
CW
640 public static function &export($prefix = FALSE) {
641 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'report_instance', $prefix, []);
60808919 642 return $r;
e501603b 643 }
c3fc2621 644
e7a6b91a
AS
645 /**
646 * Returns the list of indices
c3fc2621
CW
647 *
648 * @param bool $localize
649 *
650 * @return array
e7a6b91a
AS
651 */
652 public static function indices($localize = TRUE) {
c3fc2621 653 $indices = [];
e7a6b91a
AS
654 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
655 }
c3fc2621 656
e501603b 657}