Merge pull request #11495 from yashodha/CRM-21637
[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 'table_name' => 'civicrm_activity',
479 'entity' => 'Activity',
480 'bao' => 'CRM_Activity_BAO_Activity',
481 'localizable' => 0,
482 'html' => [
483 'type' => 'Select',
484 ],
485 ],
486 'activity_medium_id' => [
487 'name' => 'medium_id',
488 'type' => CRM_Utils_Type::T_INT,
489 'title' => ts('Activity Medium'),
490 'description' => 'Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.',
491 'default' => 'NULL',
492 'table_name' => 'civicrm_activity',
493 'entity' => 'Activity',
494 'bao' => 'CRM_Activity_BAO_Activity',
495 'localizable' => 0,
496 'html' => [
497 'type' => 'Select',
498 ],
499 'pseudoconstant' => [
500 'optionGroupName' => 'encounter_medium',
501 'optionEditPath' => 'civicrm/admin/options/encounter_medium',
502 ]
503 ],
504 'is_auto' => [
505 'name' => 'is_auto',
506 'type' => CRM_Utils_Type::T_BOOLEAN,
507 'title' => ts('Auto'),
508 'table_name' => 'civicrm_activity',
509 'entity' => 'Activity',
510 'bao' => 'CRM_Activity_BAO_Activity',
511 'localizable' => 0,
512 ],
513 'relationship_id' => [
514 'name' => 'relationship_id',
515 'type' => CRM_Utils_Type::T_INT,
516 'title' => ts('Relationship Id'),
517 'description' => 'FK to Relationship ID',
518 'default' => 'NULL',
519 'table_name' => 'civicrm_activity',
520 'entity' => 'Activity',
521 'bao' => 'CRM_Activity_BAO_Activity',
522 'localizable' => 0,
523 'FKClassName' => 'CRM_Contact_DAO_Relationship',
524 ],
525 'is_current_revision' => [
526 'name' => 'is_current_revision',
527 'type' => CRM_Utils_Type::T_BOOLEAN,
528 'title' => ts('Is this activity a current revision in versioning chain?'),
529 'import' => TRUE,
530 'where' => 'civicrm_activity.is_current_revision',
531 'headerPattern' => '/(is.)?(current.)?(revision|version(ing)?)/i',
532 'dataPattern' => '',
533 'export' => TRUE,
534 'default' => '1',
535 'table_name' => 'civicrm_activity',
536 'entity' => 'Activity',
537 'bao' => 'CRM_Activity_BAO_Activity',
538 'localizable' => 0,
539 'html' => [
540 'type' => 'CheckBox',
541 ],
542 ],
543 'original_id' => [
544 'name' => 'original_id',
545 'type' => CRM_Utils_Type::T_INT,
546 'title' => ts('Original Activity ID '),
547 'description' => 'Activity ID of the first activity record in versioning chain.',
548 'table_name' => 'civicrm_activity',
549 'entity' => 'Activity',
550 'bao' => 'CRM_Activity_BAO_Activity',
551 'localizable' => 0,
552 'FKClassName' => 'CRM_Activity_DAO_Activity',
553 ],
554 'activity_result' => [
555 'name' => 'result',
556 'type' => CRM_Utils_Type::T_STRING,
557 'title' => ts('Result'),
558 'description' => 'Currently being used to store result id for survey activity, FK to option value.',
559 'maxlength' => 255,
560 'size' => CRM_Utils_Type::HUGE,
561 'table_name' => 'civicrm_activity',
562 'entity' => 'Activity',
563 'bao' => 'CRM_Activity_BAO_Activity',
564 'localizable' => 0,
565 'html' => [
566 'type' => 'Text',
567 ],
568 ],
569 'activity_is_deleted' => [
570 'name' => 'is_deleted',
571 'type' => CRM_Utils_Type::T_BOOLEAN,
572 'title' => ts('Activity is in the Trash'),
573 'import' => TRUE,
574 'where' => 'civicrm_activity.is_deleted',
575 'headerPattern' => '/(activity.)?(trash|deleted)/i',
576 'dataPattern' => '',
577 'export' => TRUE,
578 'table_name' => 'civicrm_activity',
579 'entity' => 'Activity',
580 'bao' => 'CRM_Activity_BAO_Activity',
581 'localizable' => 0,
582 'html' => [
583 'type' => 'Text',
584 ],
585 ],
586 'activity_campaign_id' => [
587 'name' => 'campaign_id',
588 'type' => CRM_Utils_Type::T_INT,
589 'title' => ts('Campaign'),
590 'description' => 'The campaign for which this activity has been triggered.',
591 'import' => TRUE,
592 'where' => 'civicrm_activity.campaign_id',
593 'headerPattern' => '',
594 'dataPattern' => '',
595 'export' => TRUE,
596 'table_name' => 'civicrm_activity',
597 'entity' => 'Activity',
598 'bao' => 'CRM_Activity_BAO_Activity',
599 'localizable' => 0,
600 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
601 'html' => [
602 'type' => 'CheckBox',
603 ],
604 'pseudoconstant' => [
605 'table' => 'civicrm_campaign',
606 'keyColumn' => 'id',
607 'labelColumn' => 'title',
608 ]
609 ],
610 'activity_engagement_level' => [
611 'name' => 'engagement_level',
612 'type' => CRM_Utils_Type::T_INT,
613 'title' => ts('Engagement Index'),
614 'description' => 'Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.',
615 'import' => TRUE,
616 'where' => 'civicrm_activity.engagement_level',
617 'headerPattern' => '',
618 'dataPattern' => '',
619 'export' => TRUE,
620 'table_name' => 'civicrm_activity',
621 'entity' => 'Activity',
622 'bao' => 'CRM_Activity_BAO_Activity',
623 'localizable' => 0,
624 'html' => [
625 'type' => 'Select',
626 ],
627 'pseudoconstant' => [
628 'optionGroupName' => 'engagement_index',
629 'optionEditPath' => 'civicrm/admin/options/engagement_index',
630 ]
631 ],
632 'weight' => [
633 'name' => 'weight',
634 'type' => CRM_Utils_Type::T_INT,
635 'title' => ts('Order'),
636 'table_name' => 'civicrm_activity',
637 'entity' => 'Activity',
638 'bao' => 'CRM_Activity_BAO_Activity',
639 'localizable' => 0,
640 'html' => [
641 'type' => 'Text',
642 ],
643 ],
644 'is_star' => [
645 'name' => 'is_star',
646 'type' => CRM_Utils_Type::T_BOOLEAN,
647 'title' => ts('Is Starred'),
648 'description' => 'Activity marked as favorite.',
649 'import' => TRUE,
650 'where' => 'civicrm_activity.is_star',
651 'headerPattern' => '/(activity.)?(star|favorite)/i',
652 'dataPattern' => '',
653 'export' => TRUE,
654 'table_name' => 'civicrm_activity',
655 'entity' => 'Activity',
656 'bao' => 'CRM_Activity_BAO_Activity',
657 'localizable' => 0,
658 ],
659 'activity_created_date' => [
660 'name' => 'created_date',
661 'type' => CRM_Utils_Type::T_TIMESTAMP,
662 'title' => ts('Created Date'),
663 'description' => 'When was the activity was created.',
664 'required' => FALSE,
665 'export' => TRUE,
666 'where' => 'civicrm_activity.created_date',
667 'headerPattern' => '',
668 'dataPattern' => '',
669 'default' => 'NULL',
670 'table_name' => 'civicrm_activity',
671 'entity' => 'Activity',
672 'bao' => 'CRM_Activity_BAO_Activity',
673 'localizable' => 0,
674 ],
675 'activity_modified_date' => [
676 'name' => 'modified_date',
677 'type' => CRM_Utils_Type::T_TIMESTAMP,
678 'title' => ts('Modified Date'),
679 'description' => 'When was the activity (or closely related entity) was created or modified or deleted.',
680 'required' => FALSE,
681 'export' => TRUE,
682 'where' => 'civicrm_activity.modified_date',
683 'headerPattern' => '',
684 'dataPattern' => '',
685 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
686 'table_name' => 'civicrm_activity',
687 'entity' => 'Activity',
688 'bao' => 'CRM_Activity_BAO_Activity',
689 'localizable' => 0,
690 ],
691 ];
692 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
693 }
694 return Civi::$statics[__CLASS__]['fields'];
695 }
696
697 /**
698 * Return a mapping from field-name to the corresponding key (as used in fields()).
699 *
700 * @return array
701 * Array(string $name => string $uniqueName).
702 */
703 public static function &fieldKeys() {
704 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
705 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
706 }
707 return Civi::$statics[__CLASS__]['fieldKeys'];
708 }
709
710 /**
711 * Returns the names of this table
712 *
713 * @return string
714 */
715 public static function getTableName() {
716 return self::$_tableName;
717 }
718
719 /**
720 * Returns if this table needs to be logged
721 *
722 * @return bool
723 */
724 public function getLog() {
725 return self::$_log;
726 }
727
728 /**
729 * Returns the list of fields that can be imported
730 *
731 * @param bool $prefix
732 *
733 * @return array
734 */
735 public static function &import($prefix = FALSE) {
736 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'activity', $prefix, []);
737 return $r;
738 }
739
740 /**
741 * Returns the list of fields that can be exported
742 *
743 * @param bool $prefix
744 *
745 * @return array
746 */
747 public static function &export($prefix = FALSE) {
748 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'activity', $prefix, []);
749 return $r;
750 }
751
752 /**
753 * Returns the list of indices
754 *
755 * @param bool $localize
756 *
757 * @return array
758 */
759 public static function indices($localize = TRUE) {
760 $indices = [
761 'UI_source_record_id' => [
762 'name' => 'UI_source_record_id',
763 'field' => [
764 0 => 'source_record_id',
765 ],
766 'localizable' => FALSE,
767 'sig' => 'civicrm_activity::0::source_record_id',
768 ],
769 'UI_activity_type_id' => [
770 'name' => 'UI_activity_type_id',
771 'field' => [
772 0 => 'activity_type_id',
773 ],
774 'localizable' => FALSE,
775 'sig' => 'civicrm_activity::0::activity_type_id',
776 ],
777 'index_activity_date_time' => [
778 'name' => 'index_activity_date_time',
779 'field' => [
780 0 => 'activity_date_time',
781 ],
782 'localizable' => FALSE,
783 'sig' => 'civicrm_activity::0::activity_date_time',
784 ],
785 'index_status_id' => [
786 'name' => 'index_status_id',
787 'field' => [
788 0 => 'status_id',
789 ],
790 'localizable' => FALSE,
791 'sig' => 'civicrm_activity::0::status_id',
792 ],
793 'index_medium_id' => [
794 'name' => 'index_medium_id',
795 'field' => [
796 0 => 'medium_id',
797 ],
798 'localizable' => FALSE,
799 'sig' => 'civicrm_activity::0::medium_id',
800 ],
801 'index_is_current_revision' => [
802 'name' => 'index_is_current_revision',
803 'field' => [
804 0 => 'is_current_revision',
805 ],
806 'localizable' => FALSE,
807 'sig' => 'civicrm_activity::0::is_current_revision',
808 ],
809 'index_is_deleted' => [
810 'name' => 'index_is_deleted',
811 'field' => [
812 0 => 'is_deleted',
813 ],
814 'localizable' => FALSE,
815 'sig' => 'civicrm_activity::0::is_deleted',
816 ],
817 ];
818 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
819 }
820
821 }