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