Merge pull request #11949 from magnolia61/Hide_waitinglist_for_past_and_registration_...
[civicrm-core.git] / CRM / Activity / DAO / Activity.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2018
6 *
7 * Generated from xml/schema/CRM/Activity/Activity.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:dfa63754ef6ea1a9c7148e735dd6ff8a)
10 */
11
12 /**
13 * Database access object for the Activity entity.
14 */
15 class CRM_Activity_DAO_Activity extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_activity';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 static $_log = TRUE;
30
31 /**
32 * Unique Other Activity ID
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * Artificial FK to original transaction (e.g. contribution) IF it is not an Activity. Table can be figured out through activity_type_id, and further through component registry.
40 *
41 * @var int unsigned
42 */
43 public $source_record_id;
44
45 /**
46 * FK to civicrm_option_value.id, that has to be valid, registered activity type.
47 *
48 * @var int unsigned
49 */
50 public $activity_type_id;
51
52 /**
53 * The subject/purpose/short description of the activity.
54 *
55 * @var string
56 */
57 public $subject;
58
59 /**
60 * Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.
61 *
62 * @var datetime
63 */
64 public $activity_date_time;
65
66 /**
67 * Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.
68 *
69 * @var int unsigned
70 */
71 public $duration;
72
73 /**
74 * Location of the activity (optional, open text).
75 *
76 * @var string
77 */
78 public $location;
79
80 /**
81 * Phone ID of the number called (optional - used if an existing phone number is selected).
82 *
83 * @var int unsigned
84 */
85 public $phone_id;
86
87 /**
88 * Phone number in case the number does not exist in the civicrm_phone table.
89 *
90 * @var string
91 */
92 public $phone_number;
93
94 /**
95 * Details about the activity (agenda, notes, etc).
96 *
97 * @var longtext
98 */
99 public $details;
100
101 /**
102 * ID of the status this activity is currently in. Foreign key to civicrm_option_value.
103 *
104 * @var int unsigned
105 */
106 public $status_id;
107
108 /**
109 * ID of the priority given to this activity. Foreign key to civicrm_option_value.
110 *
111 * @var int unsigned
112 */
113 public $priority_id;
114
115 /**
116 * Parent meeting ID (if this is a follow-up item). This is not currently implemented
117 *
118 * @var int unsigned
119 */
120 public $parent_id;
121
122 /**
123 * @var boolean
124 */
125 public $is_test;
126
127 /**
128 * Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.
129 *
130 * @var int unsigned
131 */
132 public $medium_id;
133
134 /**
135 * @var boolean
136 */
137 public $is_auto;
138
139 /**
140 * FK to Relationship ID
141 *
142 * @var int unsigned
143 */
144 public $relationship_id;
145
146 /**
147 * @var boolean
148 */
149 public $is_current_revision;
150
151 /**
152 * Activity ID of the first activity record in versioning chain.
153 *
154 * @var int unsigned
155 */
156 public $original_id;
157
158 /**
159 * Currently being used to store result id for survey activity, FK to option value.
160 *
161 * @var string
162 */
163 public $result;
164
165 /**
166 * @var boolean
167 */
168 public $is_deleted;
169
170 /**
171 * The campaign for which this activity has been triggered.
172 *
173 * @var int unsigned
174 */
175 public $campaign_id;
176
177 /**
178 * Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.
179 *
180 * @var int unsigned
181 */
182 public $engagement_level;
183
184 /**
185 * @var int
186 */
187 public $weight;
188
189 /**
190 * Activity marked as favorite.
191 *
192 * @var boolean
193 */
194 public $is_star;
195
196 /**
197 * When was the activity was created.
198 *
199 * @var timestamp
200 */
201 public $created_date;
202
203 /**
204 * When was the activity (or closely related entity) was created or modified or deleted.
205 *
206 * @var timestamp
207 */
208 public $modified_date;
209
210 /**
211 * Class constructor.
212 */
213 public function __construct() {
214 $this->__table = 'civicrm_activity';
215 parent::__construct();
216 }
217
218 /**
219 * Returns foreign keys and entity references.
220 *
221 * @return array
222 * [CRM_Core_Reference_Interface]
223 */
224 public static function getReferenceColumns() {
225 if (!isset(Civi::$statics[__CLASS__]['links'])) {
226 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
227 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'phone_id', 'civicrm_phone', 'id');
228 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'parent_id', 'civicrm_activity', 'id');
229 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'relationship_id', 'civicrm_relationship', 'id');
230 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'original_id', 'civicrm_activity', 'id');
231 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
232 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
233 }
234 return Civi::$statics[__CLASS__]['links'];
235 }
236
237 /**
238 * Returns all the column names of this table
239 *
240 * @return array
241 */
242 public static function &fields() {
243 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
244 Civi::$statics[__CLASS__]['fields'] = [
245 'activity_id' => [
246 'name' => 'id',
247 'type' => CRM_Utils_Type::T_INT,
248 'title' => ts('Activity ID'),
249 'description' => 'Unique Other Activity ID',
250 'required' => TRUE,
251 'import' => TRUE,
252 'where' => 'civicrm_activity.id',
253 'headerPattern' => '',
254 'dataPattern' => '',
255 'export' => TRUE,
256 'table_name' => 'civicrm_activity',
257 'entity' => 'Activity',
258 'bao' => 'CRM_Activity_BAO_Activity',
259 'localizable' => 0,
260 ],
261 'source_record_id' => [
262 'name' => 'source_record_id',
263 'type' => CRM_Utils_Type::T_INT,
264 'title' => ts('Source Record'),
265 'description' => 'Artificial FK to original transaction (e.g. contribution) IF it is not an Activity. Table can be figured out through activity_type_id, and further through component registry.',
266 'table_name' => 'civicrm_activity',
267 'entity' => 'Activity',
268 'bao' => 'CRM_Activity_BAO_Activity',
269 'localizable' => 0,
270 ],
271 'activity_type_id' => [
272 'name' => 'activity_type_id',
273 'type' => CRM_Utils_Type::T_INT,
274 'title' => ts('Activity Type ID'),
275 'description' => 'FK to civicrm_option_value.id, that has to be valid, registered activity type.',
276 'required' => TRUE,
277 'import' => TRUE,
278 'where' => 'civicrm_activity.activity_type_id',
279 'headerPattern' => '/(activity.)?type(.id$)/i',
280 'dataPattern' => '',
281 'export' => TRUE,
282 'default' => '1',
283 'table_name' => 'civicrm_activity',
284 'entity' => 'Activity',
285 'bao' => 'CRM_Activity_BAO_Activity',
286 'localizable' => 0,
287 'html' => [
288 'type' => 'Select',
289 ],
290 'pseudoconstant' => [
291 'optionGroupName' => 'activity_type',
292 'optionEditPath' => 'civicrm/admin/options/activity_type',
293 ]
294 ],
295 'activity_subject' => [
296 'name' => 'subject',
297 'type' => CRM_Utils_Type::T_STRING,
298 'title' => ts('Subject'),
299 'description' => 'The subject/purpose/short description of the activity.',
300 'maxlength' => 255,
301 'size' => CRM_Utils_Type::HUGE,
302 'import' => TRUE,
303 'where' => 'civicrm_activity.subject',
304 'headerPattern' => '/(activity.)?subject/i',
305 'dataPattern' => '',
306 'export' => TRUE,
307 'table_name' => 'civicrm_activity',
308 'entity' => 'Activity',
309 'bao' => 'CRM_Activity_BAO_Activity',
310 'localizable' => 0,
311 'html' => [
312 'type' => 'Text',
313 ],
314 ],
315 'activity_date_time' => [
316 'name' => 'activity_date_time',
317 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
318 'title' => ts('Activity Date'),
319 'description' => 'Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.',
320 'import' => TRUE,
321 'where' => 'civicrm_activity.activity_date_time',
322 'headerPattern' => '/(activity.)?date(.time$)?/i',
323 'dataPattern' => '',
324 'export' => TRUE,
325 'table_name' => 'civicrm_activity',
326 'entity' => 'Activity',
327 'bao' => 'CRM_Activity_BAO_Activity',
328 'localizable' => 0,
329 'html' => [
330 'type' => 'Select Date',
331 'formatType' => 'activityDateTime',
332 ],
333 ],
334 'activity_duration' => [
335 'name' => 'duration',
336 'type' => CRM_Utils_Type::T_INT,
337 'title' => ts('Duration'),
338 'description' => 'Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.',
339 'import' => TRUE,
340 'where' => 'civicrm_activity.duration',
341 'headerPattern' => '/(activity.)?duration(s)?$/i',
342 'dataPattern' => '',
343 'export' => TRUE,
344 'table_name' => 'civicrm_activity',
345 'entity' => 'Activity',
346 'bao' => 'CRM_Activity_BAO_Activity',
347 'localizable' => 0,
348 'html' => [
349 'type' => 'Text',
350 ],
351 ],
352 'activity_location' => [
353 'name' => 'location',
354 'type' => CRM_Utils_Type::T_STRING,
355 'title' => ts('Location'),
356 'description' => 'Location of the activity (optional, open text).',
357 'maxlength' => 255,
358 'size' => CRM_Utils_Type::HUGE,
359 'import' => TRUE,
360 'where' => 'civicrm_activity.location',
361 'headerPattern' => '/(activity.)?location$/i',
362 'dataPattern' => '',
363 'export' => TRUE,
364 'table_name' => 'civicrm_activity',
365 'entity' => 'Activity',
366 'bao' => 'CRM_Activity_BAO_Activity',
367 'localizable' => 0,
368 'html' => [
369 'type' => 'Text',
370 ],
371 ],
372 'phone_id' => [
373 'name' => 'phone_id',
374 'type' => CRM_Utils_Type::T_INT,
375 'title' => ts('Phone (called) ID'),
376 'description' => 'Phone ID of the number called (optional - used if an existing phone number is selected).',
377 'table_name' => 'civicrm_activity',
378 'entity' => 'Activity',
379 'bao' => 'CRM_Activity_BAO_Activity',
380 'localizable' => 0,
381 'FKClassName' => 'CRM_Core_DAO_Phone',
382 'html' => [
383 'type' => 'EntityRef',
384 ],
385 ],
386 'phone_number' => [
387 'name' => 'phone_number',
388 'type' => CRM_Utils_Type::T_STRING,
389 'title' => ts('Phone (called) Number'),
390 'description' => 'Phone number in case the number does not exist in the civicrm_phone table.',
391 'maxlength' => 64,
392 'size' => CRM_Utils_Type::BIG,
393 'table_name' => 'civicrm_activity',
394 'entity' => 'Activity',
395 'bao' => 'CRM_Activity_BAO_Activity',
396 'localizable' => 0,
397 'html' => [
398 'type' => 'Text',
399 ],
400 ],
401 'activity_details' => [
402 'name' => 'details',
403 'type' => CRM_Utils_Type::T_LONGTEXT,
404 'title' => ts('Details'),
405 'description' => 'Details about the activity (agenda, notes, etc).',
406 'import' => TRUE,
407 'where' => 'civicrm_activity.details',
408 'headerPattern' => '/(activity.)?detail(s)?$/i',
409 'dataPattern' => '',
410 'export' => TRUE,
411 'table_name' => 'civicrm_activity',
412 'entity' => 'Activity',
413 'bao' => 'CRM_Activity_BAO_Activity',
414 'localizable' => 0,
415 'html' => [
416 'type' => 'RichTextEditor',
417 ],
418 ],
419 'activity_status_id' => [
420 'name' => 'status_id',
421 'type' => CRM_Utils_Type::T_INT,
422 'title' => ts('Activity Status'),
423 'description' => 'ID of the status this activity is currently in. Foreign key to civicrm_option_value.',
424 'import' => TRUE,
425 'where' => 'civicrm_activity.status_id',
426 'headerPattern' => '/(activity.)?status(.label$)?/i',
427 'dataPattern' => '',
428 'export' => TRUE,
429 'table_name' => 'civicrm_activity',
430 'entity' => 'Activity',
431 'bao' => 'CRM_Activity_BAO_Activity',
432 'localizable' => 0,
433 'html' => [
434 'type' => 'Select',
435 ],
436 'pseudoconstant' => [
437 'optionGroupName' => 'activity_status',
438 'optionEditPath' => 'civicrm/admin/options/activity_status',
439 ]
440 ],
441 'priority_id' => [
442 'name' => 'priority_id',
443 'type' => CRM_Utils_Type::T_INT,
444 'title' => ts('Priority'),
445 'description' => 'ID of the priority given to this activity. Foreign key to civicrm_option_value.',
446 'table_name' => 'civicrm_activity',
447 'entity' => 'Activity',
448 'bao' => 'CRM_Activity_BAO_Activity',
449 'localizable' => 0,
450 'html' => [
451 'type' => 'Select',
452 ],
453 'pseudoconstant' => [
454 'optionGroupName' => 'priority',
455 'optionEditPath' => 'civicrm/admin/options/priority',
456 ]
457 ],
458 'parent_id' => [
459 'name' => 'parent_id',
460 'type' => CRM_Utils_Type::T_INT,
461 'title' => ts('Parent Activity Id'),
462 'description' => 'Parent meeting ID (if this is a follow-up item). This is not currently implemented',
463 'table_name' => 'civicrm_activity',
464 'entity' => 'Activity',
465 'bao' => 'CRM_Activity_BAO_Activity',
466 'localizable' => 0,
467 'FKClassName' => 'CRM_Activity_DAO_Activity',
468 ],
469 'activity_is_test' => [
470 'name' => 'is_test',
471 'type' => CRM_Utils_Type::T_BOOLEAN,
472 'title' => ts('Test'),
473 'import' => TRUE,
474 'where' => 'civicrm_activity.is_test',
475 'headerPattern' => '/(is.)?test(.activity)?/i',
476 'dataPattern' => '',
477 'export' => TRUE,
478 'default' => '0',
479 'table_name' => 'civicrm_activity',
480 'entity' => 'Activity',
481 'bao' => 'CRM_Activity_BAO_Activity',
482 'localizable' => 0,
483 'html' => [
484 'type' => 'Select',
485 ],
486 ],
487 'activity_medium_id' => [
488 'name' => 'medium_id',
489 'type' => CRM_Utils_Type::T_INT,
490 'title' => ts('Activity Medium'),
491 'description' => 'Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.',
492 'default' => 'NULL',
493 'table_name' => 'civicrm_activity',
494 'entity' => 'Activity',
495 'bao' => 'CRM_Activity_BAO_Activity',
496 'localizable' => 0,
497 'html' => [
498 'type' => 'Select',
499 ],
500 'pseudoconstant' => [
501 'optionGroupName' => 'encounter_medium',
502 'optionEditPath' => 'civicrm/admin/options/encounter_medium',
503 ]
504 ],
505 'is_auto' => [
506 'name' => 'is_auto',
507 'type' => CRM_Utils_Type::T_BOOLEAN,
508 'title' => ts('Auto'),
509 'default' => '0',
510 'table_name' => 'civicrm_activity',
511 'entity' => 'Activity',
512 'bao' => 'CRM_Activity_BAO_Activity',
513 'localizable' => 0,
514 ],
515 'relationship_id' => [
516 'name' => 'relationship_id',
517 'type' => CRM_Utils_Type::T_INT,
518 'title' => ts('Relationship Id'),
519 'description' => 'FK to Relationship ID',
520 'default' => 'NULL',
521 'table_name' => 'civicrm_activity',
522 'entity' => 'Activity',
523 'bao' => 'CRM_Activity_BAO_Activity',
524 'localizable' => 0,
525 'FKClassName' => 'CRM_Contact_DAO_Relationship',
526 ],
527 'is_current_revision' => [
528 'name' => 'is_current_revision',
529 'type' => CRM_Utils_Type::T_BOOLEAN,
530 'title' => ts('Is this activity a current revision in versioning chain?'),
531 'import' => TRUE,
532 'where' => 'civicrm_activity.is_current_revision',
533 'headerPattern' => '/(is.)?(current.)?(revision|version(ing)?)/i',
534 'dataPattern' => '',
535 'export' => TRUE,
536 'default' => '1',
537 'table_name' => 'civicrm_activity',
538 'entity' => 'Activity',
539 'bao' => 'CRM_Activity_BAO_Activity',
540 'localizable' => 0,
541 'html' => [
542 'type' => 'CheckBox',
543 ],
544 ],
545 'original_id' => [
546 'name' => 'original_id',
547 'type' => CRM_Utils_Type::T_INT,
548 'title' => ts('Original Activity ID '),
549 'description' => 'Activity ID of the first activity record in versioning chain.',
550 'table_name' => 'civicrm_activity',
551 'entity' => 'Activity',
552 'bao' => 'CRM_Activity_BAO_Activity',
553 'localizable' => 0,
554 'FKClassName' => 'CRM_Activity_DAO_Activity',
555 ],
556 'activity_result' => [
557 'name' => 'result',
558 'type' => CRM_Utils_Type::T_STRING,
559 'title' => ts('Result'),
560 'description' => 'Currently being used to store result id for survey activity, FK to option value.',
561 'maxlength' => 255,
562 'size' => CRM_Utils_Type::HUGE,
563 'table_name' => 'civicrm_activity',
564 'entity' => 'Activity',
565 'bao' => 'CRM_Activity_BAO_Activity',
566 'localizable' => 0,
567 'html' => [
568 'type' => 'Text',
569 ],
570 ],
571 'activity_is_deleted' => [
572 'name' => 'is_deleted',
573 'type' => CRM_Utils_Type::T_BOOLEAN,
574 'title' => ts('Activity is in the Trash'),
575 'import' => TRUE,
576 'where' => 'civicrm_activity.is_deleted',
577 'headerPattern' => '/(activity.)?(trash|deleted)/i',
578 'dataPattern' => '',
579 'export' => TRUE,
580 'default' => '0',
581 'table_name' => 'civicrm_activity',
582 'entity' => 'Activity',
583 'bao' => 'CRM_Activity_BAO_Activity',
584 'localizable' => 0,
585 'html' => [
586 'type' => 'Text',
587 ],
588 ],
589 'activity_campaign_id' => [
590 'name' => 'campaign_id',
591 'type' => CRM_Utils_Type::T_INT,
592 'title' => ts('Campaign'),
593 'description' => 'The campaign for which this activity has been triggered.',
594 'import' => TRUE,
595 'where' => 'civicrm_activity.campaign_id',
596 'headerPattern' => '',
597 'dataPattern' => '',
598 'export' => TRUE,
599 'table_name' => 'civicrm_activity',
600 'entity' => 'Activity',
601 'bao' => 'CRM_Activity_BAO_Activity',
602 'localizable' => 0,
603 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
604 'html' => [
605 'type' => 'CheckBox',
606 ],
607 'pseudoconstant' => [
608 'table' => 'civicrm_campaign',
609 'keyColumn' => 'id',
610 'labelColumn' => 'title',
611 ]
612 ],
613 'activity_engagement_level' => [
614 'name' => 'engagement_level',
615 'type' => CRM_Utils_Type::T_INT,
616 'title' => ts('Engagement Index'),
617 'description' => 'Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.',
618 'import' => TRUE,
619 'where' => 'civicrm_activity.engagement_level',
620 'headerPattern' => '',
621 'dataPattern' => '',
622 'export' => TRUE,
623 'table_name' => 'civicrm_activity',
624 'entity' => 'Activity',
625 'bao' => 'CRM_Activity_BAO_Activity',
626 'localizable' => 0,
627 'html' => [
628 'type' => 'Select',
629 ],
630 'pseudoconstant' => [
631 'optionGroupName' => 'engagement_index',
632 'optionEditPath' => 'civicrm/admin/options/engagement_index',
633 ]
634 ],
635 'weight' => [
636 'name' => 'weight',
637 'type' => CRM_Utils_Type::T_INT,
638 'title' => ts('Order'),
639 'table_name' => 'civicrm_activity',
640 'entity' => 'Activity',
641 'bao' => 'CRM_Activity_BAO_Activity',
642 'localizable' => 0,
643 'html' => [
644 'type' => 'Text',
645 ],
646 ],
647 'is_star' => [
648 'name' => 'is_star',
649 'type' => CRM_Utils_Type::T_BOOLEAN,
650 'title' => ts('Is Starred'),
651 'description' => 'Activity marked as favorite.',
652 'import' => TRUE,
653 'where' => 'civicrm_activity.is_star',
654 'headerPattern' => '/(activity.)?(star|favorite)/i',
655 'dataPattern' => '',
656 'export' => TRUE,
657 'default' => '0',
658 'table_name' => 'civicrm_activity',
659 'entity' => 'Activity',
660 'bao' => 'CRM_Activity_BAO_Activity',
661 'localizable' => 0,
662 ],
663 'activity_created_date' => [
664 'name' => 'created_date',
665 'type' => CRM_Utils_Type::T_TIMESTAMP,
666 'title' => ts('Created Date'),
667 'description' => 'When was the activity was created.',
668 'required' => FALSE,
669 'export' => TRUE,
670 'where' => 'civicrm_activity.created_date',
671 'headerPattern' => '',
672 'dataPattern' => '',
673 'default' => 'NULL',
674 'table_name' => 'civicrm_activity',
675 'entity' => 'Activity',
676 'bao' => 'CRM_Activity_BAO_Activity',
677 'localizable' => 0,
678 ],
679 'activity_modified_date' => [
680 'name' => 'modified_date',
681 'type' => CRM_Utils_Type::T_TIMESTAMP,
682 'title' => ts('Modified Date'),
683 'description' => 'When was the activity (or closely related entity) was created or modified or deleted.',
684 'required' => FALSE,
685 'export' => TRUE,
686 'where' => 'civicrm_activity.modified_date',
687 'headerPattern' => '',
688 'dataPattern' => '',
689 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
690 'table_name' => 'civicrm_activity',
691 'entity' => 'Activity',
692 'bao' => 'CRM_Activity_BAO_Activity',
693 'localizable' => 0,
694 ],
695 ];
696 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
697 }
698 return Civi::$statics[__CLASS__]['fields'];
699 }
700
701 /**
702 * Return a mapping from field-name to the corresponding key (as used in fields()).
703 *
704 * @return array
705 * Array(string $name => string $uniqueName).
706 */
707 public static function &fieldKeys() {
708 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
709 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
710 }
711 return Civi::$statics[__CLASS__]['fieldKeys'];
712 }
713
714 /**
715 * Returns the names of this table
716 *
717 * @return string
718 */
719 public static function getTableName() {
720 return self::$_tableName;
721 }
722
723 /**
724 * Returns if this table needs to be logged
725 *
726 * @return bool
727 */
728 public function getLog() {
729 return self::$_log;
730 }
731
732 /**
733 * Returns the list of fields that can be imported
734 *
735 * @param bool $prefix
736 *
737 * @return array
738 */
739 public static function &import($prefix = FALSE) {
740 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'activity', $prefix, []);
741 return $r;
742 }
743
744 /**
745 * Returns the list of fields that can be exported
746 *
747 * @param bool $prefix
748 *
749 * @return array
750 */
751 public static function &export($prefix = FALSE) {
752 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'activity', $prefix, []);
753 return $r;
754 }
755
756 /**
757 * Returns the list of indices
758 *
759 * @param bool $localize
760 *
761 * @return array
762 */
763 public static function indices($localize = TRUE) {
764 $indices = [
765 'UI_source_record_id' => [
766 'name' => 'UI_source_record_id',
767 'field' => [
768 0 => 'source_record_id',
769 ],
770 'localizable' => FALSE,
771 'sig' => 'civicrm_activity::0::source_record_id',
772 ],
773 'UI_activity_type_id' => [
774 'name' => 'UI_activity_type_id',
775 'field' => [
776 0 => 'activity_type_id',
777 ],
778 'localizable' => FALSE,
779 'sig' => 'civicrm_activity::0::activity_type_id',
780 ],
781 'index_activity_date_time' => [
782 'name' => 'index_activity_date_time',
783 'field' => [
784 0 => 'activity_date_time',
785 ],
786 'localizable' => FALSE,
787 'sig' => 'civicrm_activity::0::activity_date_time',
788 ],
789 'index_status_id' => [
790 'name' => 'index_status_id',
791 'field' => [
792 0 => 'status_id',
793 ],
794 'localizable' => FALSE,
795 'sig' => 'civicrm_activity::0::status_id',
796 ],
797 'index_medium_id' => [
798 'name' => 'index_medium_id',
799 'field' => [
800 0 => 'medium_id',
801 ],
802 'localizable' => FALSE,
803 'sig' => 'civicrm_activity::0::medium_id',
804 ],
805 'index_is_current_revision' => [
806 'name' => 'index_is_current_revision',
807 'field' => [
808 0 => 'is_current_revision',
809 ],
810 'localizable' => FALSE,
811 'sig' => 'civicrm_activity::0::is_current_revision',
812 ],
813 'index_is_deleted' => [
814 'name' => 'index_is_deleted',
815 'field' => [
816 0 => 'is_deleted',
817 ],
818 'localizable' => FALSE,
819 'sig' => 'civicrm_activity::0::is_deleted',
820 ],
821 ];
822 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
823 }
824
825 }