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