Add unique names and unique title for recurrings.
[civicrm-core.git] / CRM / Activity / DAO / Activity.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Activity/Activity.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:fa6ffb0aaff92c8a515aff74919c7ad3)
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 public 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 public static $_log = TRUE;
30
31 /**
32 * Unique Other Activity ID
33 *
34 * @var int
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
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
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
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
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
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
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
119 */
120 public $parent_id;
121
122 /**
123 * @var bool
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
131 */
132 public $medium_id;
133
134 /**
135 * @var bool
136 */
137 public $is_auto;
138
139 /**
140 * FK to Relationship ID
141 *
142 * @var int
143 */
144 public $relationship_id;
145
146 /**
147 * @var bool
148 */
149 public $is_current_revision;
150
151 /**
152 * Activity ID of the first activity record in versioning chain.
153 *
154 * @var int
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 bool
167 */
168 public $is_deleted;
169
170 /**
171 * The campaign for which this activity has been triggered.
172 *
173 * @var int
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
181 */
182 public $engagement_level;
183
184 /**
185 * @var int
186 */
187 public $weight;
188
189 /**
190 * Activity marked as favorite.
191 *
192 * @var bool
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' => ts('Unique Other Activity ID'),
250 'required' => TRUE,
251 'import' => TRUE,
252 'where' => 'civicrm_activity.id',
253 'export' => TRUE,
254 'table_name' => 'civicrm_activity',
255 'entity' => 'Activity',
256 'bao' => 'CRM_Activity_BAO_Activity',
257 'localizable' => 0,
258 ],
259 'source_record_id' => [
260 'name' => 'source_record_id',
261 'type' => CRM_Utils_Type::T_INT,
262 'title' => ts('Source Record'),
263 'description' => ts('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.'),
264 'where' => 'civicrm_activity.source_record_id',
265 'table_name' => 'civicrm_activity',
266 'entity' => 'Activity',
267 'bao' => 'CRM_Activity_BAO_Activity',
268 'localizable' => 0,
269 ],
270 'activity_type_id' => [
271 'name' => 'activity_type_id',
272 'type' => CRM_Utils_Type::T_INT,
273 'title' => ts('Activity Type ID'),
274 'description' => ts('FK to civicrm_option_value.id, that has to be valid, registered activity type.'),
275 'required' => TRUE,
276 'import' => TRUE,
277 'where' => 'civicrm_activity.activity_type_id',
278 'headerPattern' => '/(activity.)?type(.id$)/i',
279 'export' => TRUE,
280 'default' => '1',
281 'table_name' => 'civicrm_activity',
282 'entity' => 'Activity',
283 'bao' => 'CRM_Activity_BAO_Activity',
284 'localizable' => 0,
285 'html' => [
286 'type' => 'Select',
287 ],
288 'pseudoconstant' => [
289 'optionGroupName' => 'activity_type',
290 'optionEditPath' => 'civicrm/admin/options/activity_type',
291 ],
292 ],
293 'activity_subject' => [
294 'name' => 'subject',
295 'type' => CRM_Utils_Type::T_STRING,
296 'title' => ts('Subject'),
297 'description' => ts('The subject/purpose/short description of the activity.'),
298 'maxlength' => 255,
299 'size' => CRM_Utils_Type::HUGE,
300 'import' => TRUE,
301 'where' => 'civicrm_activity.subject',
302 'headerPattern' => '/(activity.)?subject/i',
303 'export' => TRUE,
304 'table_name' => 'civicrm_activity',
305 'entity' => 'Activity',
306 'bao' => 'CRM_Activity_BAO_Activity',
307 'localizable' => 0,
308 'html' => [
309 'type' => 'Text',
310 ],
311 ],
312 'activity_date_time' => [
313 'name' => 'activity_date_time',
314 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
315 'title' => ts('Activity Date'),
316 'description' => ts('Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.'),
317 'import' => TRUE,
318 'where' => 'civicrm_activity.activity_date_time',
319 'headerPattern' => '/(activity.)?date(.time$)?/i',
320 'export' => TRUE,
321 'table_name' => 'civicrm_activity',
322 'entity' => 'Activity',
323 'bao' => 'CRM_Activity_BAO_Activity',
324 'localizable' => 0,
325 'html' => [
326 'type' => 'Select Date',
327 'formatType' => 'activityDateTime',
328 ],
329 ],
330 'activity_duration' => [
331 'name' => 'duration',
332 'type' => CRM_Utils_Type::T_INT,
333 'title' => ts('Duration'),
334 'description' => ts('Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.'),
335 'import' => TRUE,
336 'where' => 'civicrm_activity.duration',
337 'headerPattern' => '/(activity.)?duration(s)?$/i',
338 'export' => TRUE,
339 'table_name' => 'civicrm_activity',
340 'entity' => 'Activity',
341 'bao' => 'CRM_Activity_BAO_Activity',
342 'localizable' => 0,
343 'html' => [
344 'type' => 'Text',
345 ],
346 ],
347 'activity_location' => [
348 'name' => 'location',
349 'type' => CRM_Utils_Type::T_STRING,
350 'title' => ts('Location'),
351 'description' => ts('Location of the activity (optional, open text).'),
352 'maxlength' => 255,
353 'size' => CRM_Utils_Type::HUGE,
354 'import' => TRUE,
355 'where' => 'civicrm_activity.location',
356 'headerPattern' => '/(activity.)?location$/i',
357 'export' => TRUE,
358 'table_name' => 'civicrm_activity',
359 'entity' => 'Activity',
360 'bao' => 'CRM_Activity_BAO_Activity',
361 'localizable' => 0,
362 'html' => [
363 'type' => 'Text',
364 ],
365 ],
366 'phone_id' => [
367 'name' => 'phone_id',
368 'type' => CRM_Utils_Type::T_INT,
369 'title' => ts('Phone (called) ID'),
370 'description' => ts('Phone ID of the number called (optional - used if an existing phone number is selected).'),
371 'where' => 'civicrm_activity.phone_id',
372 'table_name' => 'civicrm_activity',
373 'entity' => 'Activity',
374 'bao' => 'CRM_Activity_BAO_Activity',
375 'localizable' => 0,
376 'FKClassName' => 'CRM_Core_DAO_Phone',
377 'html' => [
378 'type' => 'EntityRef',
379 ],
380 ],
381 'phone_number' => [
382 'name' => 'phone_number',
383 'type' => CRM_Utils_Type::T_STRING,
384 'title' => ts('Phone (called) Number'),
385 'description' => ts('Phone number in case the number does not exist in the civicrm_phone table.'),
386 'maxlength' => 64,
387 'size' => CRM_Utils_Type::BIG,
388 'where' => 'civicrm_activity.phone_number',
389 'table_name' => 'civicrm_activity',
390 'entity' => 'Activity',
391 'bao' => 'CRM_Activity_BAO_Activity',
392 'localizable' => 0,
393 'html' => [
394 'type' => 'Text',
395 ],
396 ],
397 'activity_details' => [
398 'name' => 'details',
399 'type' => CRM_Utils_Type::T_LONGTEXT,
400 'title' => ts('Details'),
401 'description' => ts('Details about the activity (agenda, notes, etc).'),
402 'import' => TRUE,
403 'where' => 'civicrm_activity.details',
404 'headerPattern' => '/(activity.)?detail(s)?$/i',
405 'export' => TRUE,
406 'table_name' => 'civicrm_activity',
407 'entity' => 'Activity',
408 'bao' => 'CRM_Activity_BAO_Activity',
409 'localizable' => 0,
410 'html' => [
411 'type' => 'RichTextEditor',
412 ],
413 ],
414 'activity_status_id' => [
415 'name' => 'status_id',
416 'type' => CRM_Utils_Type::T_INT,
417 'title' => ts('Activity Status'),
418 'description' => ts('ID of the status this activity is currently in. Foreign key to civicrm_option_value.'),
419 'import' => TRUE,
420 'where' => 'civicrm_activity.status_id',
421 'headerPattern' => '/(activity.)?status(.label$)?/i',
422 'export' => TRUE,
423 'table_name' => 'civicrm_activity',
424 'entity' => 'Activity',
425 'bao' => 'CRM_Activity_BAO_Activity',
426 'localizable' => 0,
427 'html' => [
428 'type' => 'Select',
429 ],
430 'pseudoconstant' => [
431 'optionGroupName' => 'activity_status',
432 'optionEditPath' => 'civicrm/admin/options/activity_status',
433 ],
434 ],
435 'priority_id' => [
436 'name' => 'priority_id',
437 'type' => CRM_Utils_Type::T_INT,
438 'title' => ts('Priority'),
439 'description' => ts('ID of the priority given to this activity. Foreign key to civicrm_option_value.'),
440 'where' => 'civicrm_activity.priority_id',
441 'table_name' => 'civicrm_activity',
442 'entity' => 'Activity',
443 'bao' => 'CRM_Activity_BAO_Activity',
444 'localizable' => 0,
445 'html' => [
446 'type' => 'Select',
447 ],
448 'pseudoconstant' => [
449 'optionGroupName' => 'priority',
450 'optionEditPath' => 'civicrm/admin/options/priority',
451 ],
452 ],
453 'parent_id' => [
454 'name' => 'parent_id',
455 'type' => CRM_Utils_Type::T_INT,
456 'title' => ts('Parent Activity Id'),
457 'description' => ts('Parent meeting ID (if this is a follow-up item). This is not currently implemented'),
458 'where' => 'civicrm_activity.parent_id',
459 'table_name' => 'civicrm_activity',
460 'entity' => 'Activity',
461 'bao' => 'CRM_Activity_BAO_Activity',
462 'localizable' => 0,
463 'FKClassName' => 'CRM_Activity_DAO_Activity',
464 ],
465 'activity_is_test' => [
466 'name' => 'is_test',
467 'type' => CRM_Utils_Type::T_BOOLEAN,
468 'title' => ts('Test'),
469 'import' => TRUE,
470 'where' => 'civicrm_activity.is_test',
471 'headerPattern' => '/(is.)?test(.activity)?/i',
472 'export' => TRUE,
473 'default' => '0',
474 'table_name' => 'civicrm_activity',
475 'entity' => 'Activity',
476 'bao' => 'CRM_Activity_BAO_Activity',
477 'localizable' => 0,
478 'html' => [
479 'type' => 'Select',
480 ],
481 ],
482 'activity_medium_id' => [
483 'name' => 'medium_id',
484 'type' => CRM_Utils_Type::T_INT,
485 'title' => ts('Activity Medium'),
486 'description' => ts('Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.'),
487 'where' => 'civicrm_activity.medium_id',
488 'default' => 'NULL',
489 'table_name' => 'civicrm_activity',
490 'entity' => 'Activity',
491 'bao' => 'CRM_Activity_BAO_Activity',
492 'localizable' => 0,
493 'html' => [
494 'type' => 'Select',
495 ],
496 'pseudoconstant' => [
497 'optionGroupName' => 'encounter_medium',
498 'optionEditPath' => 'civicrm/admin/options/encounter_medium',
499 ],
500 ],
501 'is_auto' => [
502 'name' => 'is_auto',
503 'type' => CRM_Utils_Type::T_BOOLEAN,
504 'title' => ts('Auto'),
505 'where' => 'civicrm_activity.is_auto',
506 'default' => '0',
507 'table_name' => 'civicrm_activity',
508 'entity' => 'Activity',
509 'bao' => 'CRM_Activity_BAO_Activity',
510 'localizable' => 0,
511 ],
512 'relationship_id' => [
513 'name' => 'relationship_id',
514 'type' => CRM_Utils_Type::T_INT,
515 'title' => ts('Relationship Id'),
516 'description' => ts('FK to Relationship ID'),
517 'where' => 'civicrm_activity.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 'export' => TRUE,
533 'default' => '1',
534 'table_name' => 'civicrm_activity',
535 'entity' => 'Activity',
536 'bao' => 'CRM_Activity_BAO_Activity',
537 'localizable' => 0,
538 'html' => [
539 'type' => 'CheckBox',
540 ],
541 ],
542 'original_id' => [
543 'name' => 'original_id',
544 'type' => CRM_Utils_Type::T_INT,
545 'title' => ts('Original Activity ID '),
546 'description' => ts('Activity ID of the first activity record in versioning chain.'),
547 'where' => 'civicrm_activity.original_id',
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' => ts('Currently being used to store result id for survey activity, FK to option value.'),
559 'maxlength' => 255,
560 'size' => CRM_Utils_Type::HUGE,
561 'where' => 'civicrm_activity.result',
562 'table_name' => 'civicrm_activity',
563 'entity' => 'Activity',
564 'bao' => 'CRM_Activity_BAO_Activity',
565 'localizable' => 0,
566 'html' => [
567 'type' => 'Text',
568 ],
569 ],
570 'activity_is_deleted' => [
571 'name' => 'is_deleted',
572 'type' => CRM_Utils_Type::T_BOOLEAN,
573 'title' => ts('Activity is in the Trash'),
574 'import' => TRUE,
575 'where' => 'civicrm_activity.is_deleted',
576 'headerPattern' => '/(activity.)?(trash|deleted)/i',
577 'export' => TRUE,
578 'default' => '0',
579 'table_name' => 'civicrm_activity',
580 'entity' => 'Activity',
581 'bao' => 'CRM_Activity_BAO_Activity',
582 'localizable' => 0,
583 'html' => [
584 'type' => 'Text',
585 ],
586 ],
587 'activity_campaign_id' => [
588 'name' => 'campaign_id',
589 'type' => CRM_Utils_Type::T_INT,
590 'title' => ts('Campaign'),
591 'description' => ts('The campaign for which this activity has been triggered.'),
592 'import' => TRUE,
593 'where' => 'civicrm_activity.campaign_id',
594 'export' => TRUE,
595 'table_name' => 'civicrm_activity',
596 'entity' => 'Activity',
597 'bao' => 'CRM_Activity_BAO_Activity',
598 'localizable' => 0,
599 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
600 'html' => [
601 'type' => 'CheckBox',
602 ],
603 'pseudoconstant' => [
604 'table' => 'civicrm_campaign',
605 'keyColumn' => 'id',
606 'labelColumn' => 'title',
607 ],
608 ],
609 'activity_engagement_level' => [
610 'name' => 'engagement_level',
611 'type' => CRM_Utils_Type::T_INT,
612 'title' => ts('Engagement Index'),
613 'description' => ts('Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.'),
614 'import' => TRUE,
615 'where' => 'civicrm_activity.engagement_level',
616 'export' => TRUE,
617 'table_name' => 'civicrm_activity',
618 'entity' => 'Activity',
619 'bao' => 'CRM_Activity_BAO_Activity',
620 'localizable' => 0,
621 'html' => [
622 'type' => 'Select',
623 ],
624 'pseudoconstant' => [
625 'optionGroupName' => 'engagement_index',
626 'optionEditPath' => 'civicrm/admin/options/engagement_index',
627 ],
628 ],
629 'weight' => [
630 'name' => 'weight',
631 'type' => CRM_Utils_Type::T_INT,
632 'title' => ts('Order'),
633 'where' => 'civicrm_activity.weight',
634 'table_name' => 'civicrm_activity',
635 'entity' => 'Activity',
636 'bao' => 'CRM_Activity_BAO_Activity',
637 'localizable' => 0,
638 'html' => [
639 'type' => 'Text',
640 ],
641 ],
642 'is_star' => [
643 'name' => 'is_star',
644 'type' => CRM_Utils_Type::T_BOOLEAN,
645 'title' => ts('Is Starred'),
646 'description' => ts('Activity marked as favorite.'),
647 'import' => TRUE,
648 'where' => 'civicrm_activity.is_star',
649 'headerPattern' => '/(activity.)?(star|favorite)/i',
650 'export' => TRUE,
651 'default' => '0',
652 'table_name' => 'civicrm_activity',
653 'entity' => 'Activity',
654 'bao' => 'CRM_Activity_BAO_Activity',
655 'localizable' => 0,
656 ],
657 'activity_created_date' => [
658 'name' => 'created_date',
659 'type' => CRM_Utils_Type::T_TIMESTAMP,
660 'title' => ts('Created Date'),
661 'description' => ts('When was the activity was created.'),
662 'required' => FALSE,
663 'where' => 'civicrm_activity.created_date',
664 'export' => TRUE,
665 'default' => 'NULL',
666 'table_name' => 'civicrm_activity',
667 'entity' => 'Activity',
668 'bao' => 'CRM_Activity_BAO_Activity',
669 'localizable' => 0,
670 ],
671 'activity_modified_date' => [
672 'name' => 'modified_date',
673 'type' => CRM_Utils_Type::T_TIMESTAMP,
674 'title' => ts('Modified Date'),
675 'description' => ts('When was the activity (or closely related entity) was created or modified or deleted.'),
676 'required' => FALSE,
677 'where' => 'civicrm_activity.modified_date',
678 'export' => TRUE,
679 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
680 'table_name' => 'civicrm_activity',
681 'entity' => 'Activity',
682 'bao' => 'CRM_Activity_BAO_Activity',
683 'localizable' => 0,
684 ],
685 ];
686 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
687 }
688 return Civi::$statics[__CLASS__]['fields'];
689 }
690
691 /**
692 * Return a mapping from field-name to the corresponding key (as used in fields()).
693 *
694 * @return array
695 * Array(string $name => string $uniqueName).
696 */
697 public static function &fieldKeys() {
698 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
699 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
700 }
701 return Civi::$statics[__CLASS__]['fieldKeys'];
702 }
703
704 /**
705 * Returns the names of this table
706 *
707 * @return string
708 */
709 public static function getTableName() {
710 return self::$_tableName;
711 }
712
713 /**
714 * Returns if this table needs to be logged
715 *
716 * @return bool
717 */
718 public function getLog() {
719 return self::$_log;
720 }
721
722 /**
723 * Returns the list of fields that can be imported
724 *
725 * @param bool $prefix
726 *
727 * @return array
728 */
729 public static function &import($prefix = FALSE) {
730 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'activity', $prefix, []);
731 return $r;
732 }
733
734 /**
735 * Returns the list of fields that can be exported
736 *
737 * @param bool $prefix
738 *
739 * @return array
740 */
741 public static function &export($prefix = FALSE) {
742 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'activity', $prefix, []);
743 return $r;
744 }
745
746 /**
747 * Returns the list of indices
748 *
749 * @param bool $localize
750 *
751 * @return array
752 */
753 public static function indices($localize = TRUE) {
754 $indices = [
755 'UI_source_record_id' => [
756 'name' => 'UI_source_record_id',
757 'field' => [
758 0 => 'source_record_id',
759 ],
760 'localizable' => FALSE,
761 'sig' => 'civicrm_activity::0::source_record_id',
762 ],
763 'UI_activity_type_id' => [
764 'name' => 'UI_activity_type_id',
765 'field' => [
766 0 => 'activity_type_id',
767 ],
768 'localizable' => FALSE,
769 'sig' => 'civicrm_activity::0::activity_type_id',
770 ],
771 'index_activity_date_time' => [
772 'name' => 'index_activity_date_time',
773 'field' => [
774 0 => 'activity_date_time',
775 ],
776 'localizable' => FALSE,
777 'sig' => 'civicrm_activity::0::activity_date_time',
778 ],
779 'index_status_id' => [
780 'name' => 'index_status_id',
781 'field' => [
782 0 => 'status_id',
783 ],
784 'localizable' => FALSE,
785 'sig' => 'civicrm_activity::0::status_id',
786 ],
787 'index_medium_id' => [
788 'name' => 'index_medium_id',
789 'field' => [
790 0 => 'medium_id',
791 ],
792 'localizable' => FALSE,
793 'sig' => 'civicrm_activity::0::medium_id',
794 ],
795 'index_is_current_revision' => [
796 'name' => 'index_is_current_revision',
797 'field' => [
798 0 => 'is_current_revision',
799 ],
800 'localizable' => FALSE,
801 'sig' => 'civicrm_activity::0::is_current_revision',
802 ],
803 'index_is_deleted' => [
804 'name' => 'index_is_deleted',
805 'field' => [
806 0 => 'is_deleted',
807 ],
808 'localizable' => FALSE,
809 'sig' => 'civicrm_activity::0::is_deleted',
810 ],
811 ];
812 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
813 }
814
815 }