Merge pull request #18316 from civicrm/5.29
[civicrm-core.git] / CRM / Core / DAO / ActionSchedule.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/ActionSchedule.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:d05639de89f460efbb3474dcaf5acd27)
10 */
11
12 /**
13 * Database access object for the ActionSchedule entity.
14 */
15 class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '3.4';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_action_schedule';
25
26 /**
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
28 *
29 * @var bool
30 */
31 public static $_log = FALSE;
32
33 /**
34 * @var int
35 */
36 public $id;
37
38 /**
39 * Name of the action(reminder)
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Title of the action(reminder)
47 *
48 * @var string
49 */
50 public $title;
51
52 /**
53 * Recipient
54 *
55 * @var string
56 */
57 public $recipient;
58
59 /**
60 * Is this the recipient criteria limited to OR in addition to?
61 *
62 * @var bool
63 */
64 public $limit_to;
65
66 /**
67 * Entity value
68 *
69 * @var string
70 */
71 public $entity_value;
72
73 /**
74 * Entity status
75 *
76 * @var string
77 */
78 public $entity_status;
79
80 /**
81 * Reminder Interval.
82 *
83 * @var int
84 */
85 public $start_action_offset;
86
87 /**
88 * Time units for reminder.
89 *
90 * @var string
91 */
92 public $start_action_unit;
93
94 /**
95 * Reminder Action
96 *
97 * @var string
98 */
99 public $start_action_condition;
100
101 /**
102 * Entity date
103 *
104 * @var string
105 */
106 public $start_action_date;
107
108 /**
109 * @var bool
110 */
111 public $is_repeat;
112
113 /**
114 * Time units for repetition of reminder.
115 *
116 * @var string
117 */
118 public $repetition_frequency_unit;
119
120 /**
121 * Time interval for repeating the reminder.
122 *
123 * @var int
124 */
125 public $repetition_frequency_interval;
126
127 /**
128 * Time units till repetition of reminder.
129 *
130 * @var string
131 */
132 public $end_frequency_unit;
133
134 /**
135 * Time interval till repeating the reminder.
136 *
137 * @var int
138 */
139 public $end_frequency_interval;
140
141 /**
142 * Reminder Action till repeating the reminder.
143 *
144 * @var string
145 */
146 public $end_action;
147
148 /**
149 * Entity end date
150 *
151 * @var string
152 */
153 public $end_date;
154
155 /**
156 * Is this option active?
157 *
158 * @var bool
159 */
160 public $is_active;
161
162 /**
163 * Contact IDs to which reminder should be sent.
164 *
165 * @var string
166 */
167 public $recipient_manual;
168
169 /**
170 * listing based on recipient field.
171 *
172 * @var string
173 */
174 public $recipient_listing;
175
176 /**
177 * Body of the mailing in text format.
178 *
179 * @var longtext
180 */
181 public $body_text;
182
183 /**
184 * Body of the mailing in html format.
185 *
186 * @var longtext
187 */
188 public $body_html;
189
190 /**
191 * Content of the SMS text.
192 *
193 * @var longtext
194 */
195 public $sms_body_text;
196
197 /**
198 * Subject of mailing
199 *
200 * @var string
201 */
202 public $subject;
203
204 /**
205 * Record Activity for this reminder?
206 *
207 * @var bool
208 */
209 public $record_activity;
210
211 /**
212 * Name/ID of the mapping to use on this table
213 *
214 * @var string
215 */
216 public $mapping_id;
217
218 /**
219 * FK to Group
220 *
221 * @var int
222 */
223 public $group_id;
224
225 /**
226 * FK to the message template.
227 *
228 * @var int
229 */
230 public $msg_template_id;
231
232 /**
233 * FK to the message template.
234 *
235 * @var int
236 */
237 public $sms_template_id;
238
239 /**
240 * Date on which the reminder be sent.
241 *
242 * @var date
243 */
244 public $absolute_date;
245
246 /**
247 * Name in "from" field
248 *
249 * @var string
250 */
251 public $from_name;
252
253 /**
254 * Email address in "from" field
255 *
256 * @var string
257 */
258 public $from_email;
259
260 /**
261 * Send the message as email or sms or both.
262 *
263 * @var string
264 */
265 public $mode;
266
267 /**
268 * @var int
269 */
270 public $sms_provider_id;
271
272 /**
273 * Used for repeating entity
274 *
275 * @var string
276 */
277 public $used_for;
278
279 /**
280 * Used for multilingual installation
281 *
282 * @var string
283 */
284 public $filter_contact_language;
285
286 /**
287 * Used for multilingual installation
288 *
289 * @var string
290 */
291 public $communication_language;
292
293 /**
294 * Class constructor.
295 */
296 public function __construct() {
297 $this->__table = 'civicrm_action_schedule';
298 parent::__construct();
299 }
300
301 /**
302 * Returns localized title of this entity.
303 */
304 public static function getEntityTitle() {
305 return ts('Action Schedules');
306 }
307
308 /**
309 * Returns foreign keys and entity references.
310 *
311 * @return array
312 * [CRM_Core_Reference_Interface]
313 */
314 public static function getReferenceColumns() {
315 if (!isset(Civi::$statics[__CLASS__]['links'])) {
316 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
317 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'group_id', 'civicrm_group', 'id');
318 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id');
319 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'sms_template_id', 'civicrm_msg_template', 'id');
320 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id');
321 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
322 }
323 return Civi::$statics[__CLASS__]['links'];
324 }
325
326 /**
327 * Returns all the column names of this table
328 *
329 * @return array
330 */
331 public static function &fields() {
332 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
333 Civi::$statics[__CLASS__]['fields'] = [
334 'id' => [
335 'name' => 'id',
336 'type' => CRM_Utils_Type::T_INT,
337 'title' => ts('Action Schedule ID'),
338 'required' => TRUE,
339 'where' => 'civicrm_action_schedule.id',
340 'table_name' => 'civicrm_action_schedule',
341 'entity' => 'ActionSchedule',
342 'bao' => 'CRM_Core_BAO_ActionSchedule',
343 'localizable' => 0,
344 'add' => '3.4',
345 ],
346 'name' => [
347 'name' => 'name',
348 'type' => CRM_Utils_Type::T_STRING,
349 'title' => ts('Name'),
350 'description' => ts('Name of the action(reminder)'),
351 'maxlength' => 64,
352 'size' => CRM_Utils_Type::BIG,
353 'where' => 'civicrm_action_schedule.name',
354 'table_name' => 'civicrm_action_schedule',
355 'entity' => 'ActionSchedule',
356 'bao' => 'CRM_Core_BAO_ActionSchedule',
357 'localizable' => 0,
358 'add' => '3.4',
359 ],
360 'title' => [
361 'name' => 'title',
362 'type' => CRM_Utils_Type::T_STRING,
363 'title' => ts('Title'),
364 'description' => ts('Title of the action(reminder)'),
365 'maxlength' => 64,
366 'size' => CRM_Utils_Type::BIG,
367 'where' => 'civicrm_action_schedule.title',
368 'table_name' => 'civicrm_action_schedule',
369 'entity' => 'ActionSchedule',
370 'bao' => 'CRM_Core_BAO_ActionSchedule',
371 'localizable' => 0,
372 'add' => '3.4',
373 ],
374 'recipient' => [
375 'name' => 'recipient',
376 'type' => CRM_Utils_Type::T_STRING,
377 'title' => ts('Recipient'),
378 'description' => ts('Recipient'),
379 'maxlength' => 64,
380 'size' => CRM_Utils_Type::BIG,
381 'where' => 'civicrm_action_schedule.recipient',
382 'table_name' => 'civicrm_action_schedule',
383 'entity' => 'ActionSchedule',
384 'bao' => 'CRM_Core_BAO_ActionSchedule',
385 'localizable' => 0,
386 'add' => '3.4',
387 ],
388 'limit_to' => [
389 'name' => 'limit_to',
390 'type' => CRM_Utils_Type::T_BOOLEAN,
391 'title' => ts('Limit To'),
392 'description' => ts('Is this the recipient criteria limited to OR in addition to?'),
393 'where' => 'civicrm_action_schedule.limit_to',
394 'table_name' => 'civicrm_action_schedule',
395 'entity' => 'ActionSchedule',
396 'bao' => 'CRM_Core_BAO_ActionSchedule',
397 'localizable' => 0,
398 'add' => '4.4',
399 ],
400 'entity_value' => [
401 'name' => 'entity_value',
402 'type' => CRM_Utils_Type::T_STRING,
403 'title' => ts('Entity Value'),
404 'description' => ts('Entity value'),
405 'maxlength' => 255,
406 'size' => CRM_Utils_Type::HUGE,
407 'where' => 'civicrm_action_schedule.entity_value',
408 'table_name' => 'civicrm_action_schedule',
409 'entity' => 'ActionSchedule',
410 'bao' => 'CRM_Core_BAO_ActionSchedule',
411 'localizable' => 0,
412 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
413 'add' => '3.4',
414 ],
415 'entity_status' => [
416 'name' => 'entity_status',
417 'type' => CRM_Utils_Type::T_STRING,
418 'title' => ts('Entity Status'),
419 'description' => ts('Entity status'),
420 'maxlength' => 64,
421 'size' => CRM_Utils_Type::BIG,
422 'where' => 'civicrm_action_schedule.entity_status',
423 'table_name' => 'civicrm_action_schedule',
424 'entity' => 'ActionSchedule',
425 'bao' => 'CRM_Core_BAO_ActionSchedule',
426 'localizable' => 0,
427 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
428 'add' => '3.4',
429 ],
430 'start_action_offset' => [
431 'name' => 'start_action_offset',
432 'type' => CRM_Utils_Type::T_INT,
433 'title' => ts('Start Action Offset'),
434 'description' => ts('Reminder Interval.'),
435 'where' => 'civicrm_action_schedule.start_action_offset',
436 'default' => '0',
437 'table_name' => 'civicrm_action_schedule',
438 'entity' => 'ActionSchedule',
439 'bao' => 'CRM_Core_BAO_ActionSchedule',
440 'localizable' => 0,
441 'add' => '3.4',
442 ],
443 'start_action_unit' => [
444 'name' => 'start_action_unit',
445 'type' => CRM_Utils_Type::T_STRING,
446 'title' => ts('Start Action Unit'),
447 'description' => ts('Time units for reminder.'),
448 'maxlength' => 8,
449 'size' => CRM_Utils_Type::EIGHT,
450 'where' => 'civicrm_action_schedule.start_action_unit',
451 'table_name' => 'civicrm_action_schedule',
452 'entity' => 'ActionSchedule',
453 'bao' => 'CRM_Core_BAO_ActionSchedule',
454 'localizable' => 0,
455 'html' => [
456 'type' => 'Select',
457 ],
458 'pseudoconstant' => [
459 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
460 ],
461 'add' => '3.4',
462 ],
463 'start_action_condition' => [
464 'name' => 'start_action_condition',
465 'type' => CRM_Utils_Type::T_STRING,
466 'title' => ts('Start Action Condition'),
467 'description' => ts('Reminder Action'),
468 'maxlength' => 64,
469 'size' => CRM_Utils_Type::BIG,
470 'where' => 'civicrm_action_schedule.start_action_condition',
471 'table_name' => 'civicrm_action_schedule',
472 'entity' => 'ActionSchedule',
473 'bao' => 'CRM_Core_BAO_ActionSchedule',
474 'localizable' => 0,
475 'add' => '3.4',
476 ],
477 'start_action_date' => [
478 'name' => 'start_action_date',
479 'type' => CRM_Utils_Type::T_STRING,
480 'title' => ts('Start Action Date'),
481 'description' => ts('Entity date'),
482 'maxlength' => 64,
483 'size' => CRM_Utils_Type::BIG,
484 'where' => 'civicrm_action_schedule.start_action_date',
485 'table_name' => 'civicrm_action_schedule',
486 'entity' => 'ActionSchedule',
487 'bao' => 'CRM_Core_BAO_ActionSchedule',
488 'localizable' => 0,
489 'add' => '3.4',
490 ],
491 'is_repeat' => [
492 'name' => 'is_repeat',
493 'type' => CRM_Utils_Type::T_BOOLEAN,
494 'title' => ts('Repeat?'),
495 'where' => 'civicrm_action_schedule.is_repeat',
496 'default' => '0',
497 'table_name' => 'civicrm_action_schedule',
498 'entity' => 'ActionSchedule',
499 'bao' => 'CRM_Core_BAO_ActionSchedule',
500 'localizable' => 0,
501 'add' => '3.4',
502 ],
503 'repetition_frequency_unit' => [
504 'name' => 'repetition_frequency_unit',
505 'type' => CRM_Utils_Type::T_STRING,
506 'title' => ts('Repetition Frequency Unit'),
507 'description' => ts('Time units for repetition of reminder.'),
508 'maxlength' => 8,
509 'size' => CRM_Utils_Type::EIGHT,
510 'where' => 'civicrm_action_schedule.repetition_frequency_unit',
511 'table_name' => 'civicrm_action_schedule',
512 'entity' => 'ActionSchedule',
513 'bao' => 'CRM_Core_BAO_ActionSchedule',
514 'localizable' => 0,
515 'html' => [
516 'type' => 'Select',
517 ],
518 'pseudoconstant' => [
519 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
520 ],
521 'add' => '3.4',
522 ],
523 'repetition_frequency_interval' => [
524 'name' => 'repetition_frequency_interval',
525 'type' => CRM_Utils_Type::T_INT,
526 'title' => ts('Repetition Frequency Interval'),
527 'description' => ts('Time interval for repeating the reminder.'),
528 'where' => 'civicrm_action_schedule.repetition_frequency_interval',
529 'default' => '0',
530 'table_name' => 'civicrm_action_schedule',
531 'entity' => 'ActionSchedule',
532 'bao' => 'CRM_Core_BAO_ActionSchedule',
533 'localizable' => 0,
534 'add' => '3.4',
535 ],
536 'end_frequency_unit' => [
537 'name' => 'end_frequency_unit',
538 'type' => CRM_Utils_Type::T_STRING,
539 'title' => ts('End Frequency Unit'),
540 'description' => ts('Time units till repetition of reminder.'),
541 'maxlength' => 8,
542 'size' => CRM_Utils_Type::EIGHT,
543 'where' => 'civicrm_action_schedule.end_frequency_unit',
544 'table_name' => 'civicrm_action_schedule',
545 'entity' => 'ActionSchedule',
546 'bao' => 'CRM_Core_BAO_ActionSchedule',
547 'localizable' => 0,
548 'html' => [
549 'type' => 'Select',
550 ],
551 'pseudoconstant' => [
552 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
553 ],
554 'add' => '3.4',
555 ],
556 'end_frequency_interval' => [
557 'name' => 'end_frequency_interval',
558 'type' => CRM_Utils_Type::T_INT,
559 'title' => ts('End Frequency Interval'),
560 'description' => ts('Time interval till repeating the reminder.'),
561 'where' => 'civicrm_action_schedule.end_frequency_interval',
562 'default' => '0',
563 'table_name' => 'civicrm_action_schedule',
564 'entity' => 'ActionSchedule',
565 'bao' => 'CRM_Core_BAO_ActionSchedule',
566 'localizable' => 0,
567 'add' => '3.4',
568 ],
569 'end_action' => [
570 'name' => 'end_action',
571 'type' => CRM_Utils_Type::T_STRING,
572 'title' => ts('End Action'),
573 'description' => ts('Reminder Action till repeating the reminder.'),
574 'maxlength' => 32,
575 'size' => CRM_Utils_Type::MEDIUM,
576 'where' => 'civicrm_action_schedule.end_action',
577 'table_name' => 'civicrm_action_schedule',
578 'entity' => 'ActionSchedule',
579 'bao' => 'CRM_Core_BAO_ActionSchedule',
580 'localizable' => 0,
581 'add' => '3.4',
582 ],
583 'end_date' => [
584 'name' => 'end_date',
585 'type' => CRM_Utils_Type::T_STRING,
586 'title' => ts('End Date'),
587 'description' => ts('Entity end date'),
588 'maxlength' => 64,
589 'size' => CRM_Utils_Type::BIG,
590 'where' => 'civicrm_action_schedule.end_date',
591 'table_name' => 'civicrm_action_schedule',
592 'entity' => 'ActionSchedule',
593 'bao' => 'CRM_Core_BAO_ActionSchedule',
594 'localizable' => 0,
595 'add' => '3.4',
596 ],
597 'is_active' => [
598 'name' => 'is_active',
599 'type' => CRM_Utils_Type::T_BOOLEAN,
600 'title' => ts('Schedule is Active?'),
601 'description' => ts('Is this option active?'),
602 'where' => 'civicrm_action_schedule.is_active',
603 'default' => '1',
604 'table_name' => 'civicrm_action_schedule',
605 'entity' => 'ActionSchedule',
606 'bao' => 'CRM_Core_BAO_ActionSchedule',
607 'localizable' => 0,
608 'add' => '3.4',
609 ],
610 'recipient_manual' => [
611 'name' => 'recipient_manual',
612 'type' => CRM_Utils_Type::T_STRING,
613 'title' => ts('Recipient Manual'),
614 'description' => ts('Contact IDs to which reminder should be sent.'),
615 'maxlength' => 128,
616 'size' => CRM_Utils_Type::HUGE,
617 'where' => 'civicrm_action_schedule.recipient_manual',
618 'table_name' => 'civicrm_action_schedule',
619 'entity' => 'ActionSchedule',
620 'bao' => 'CRM_Core_BAO_ActionSchedule',
621 'localizable' => 0,
622 'serialize' => self::SERIALIZE_COMMA,
623 'add' => '3.4',
624 ],
625 'recipient_listing' => [
626 'name' => 'recipient_listing',
627 'type' => CRM_Utils_Type::T_STRING,
628 'title' => ts('Recipient Listing'),
629 'description' => ts('listing based on recipient field.'),
630 'maxlength' => 128,
631 'size' => CRM_Utils_Type::HUGE,
632 'where' => 'civicrm_action_schedule.recipient_listing',
633 'table_name' => 'civicrm_action_schedule',
634 'entity' => 'ActionSchedule',
635 'bao' => 'CRM_Core_BAO_ActionSchedule',
636 'localizable' => 0,
637 'add' => '4.1',
638 ],
639 'body_text' => [
640 'name' => 'body_text',
641 'type' => CRM_Utils_Type::T_LONGTEXT,
642 'title' => ts('Reminder Text'),
643 'description' => ts('Body of the mailing in text format.'),
644 'where' => 'civicrm_action_schedule.body_text',
645 'table_name' => 'civicrm_action_schedule',
646 'entity' => 'ActionSchedule',
647 'bao' => 'CRM_Core_BAO_ActionSchedule',
648 'localizable' => 0,
649 'add' => '3.4',
650 ],
651 'body_html' => [
652 'name' => 'body_html',
653 'type' => CRM_Utils_Type::T_LONGTEXT,
654 'title' => ts('Reminder HTML'),
655 'description' => ts('Body of the mailing in html format.'),
656 'where' => 'civicrm_action_schedule.body_html',
657 'table_name' => 'civicrm_action_schedule',
658 'entity' => 'ActionSchedule',
659 'bao' => 'CRM_Core_BAO_ActionSchedule',
660 'localizable' => 0,
661 'add' => '3.4',
662 ],
663 'sms_body_text' => [
664 'name' => 'sms_body_text',
665 'type' => CRM_Utils_Type::T_LONGTEXT,
666 'title' => ts('SMS Reminder Text'),
667 'description' => ts('Content of the SMS text.'),
668 'where' => 'civicrm_action_schedule.sms_body_text',
669 'table_name' => 'civicrm_action_schedule',
670 'entity' => 'ActionSchedule',
671 'bao' => 'CRM_Core_BAO_ActionSchedule',
672 'localizable' => 0,
673 'add' => '4.5',
674 ],
675 'subject' => [
676 'name' => 'subject',
677 'type' => CRM_Utils_Type::T_STRING,
678 'title' => ts('Reminder Subject'),
679 'description' => ts('Subject of mailing'),
680 'maxlength' => 128,
681 'size' => CRM_Utils_Type::HUGE,
682 'where' => 'civicrm_action_schedule.subject',
683 'table_name' => 'civicrm_action_schedule',
684 'entity' => 'ActionSchedule',
685 'bao' => 'CRM_Core_BAO_ActionSchedule',
686 'localizable' => 0,
687 'add' => '3.4',
688 ],
689 'record_activity' => [
690 'name' => 'record_activity',
691 'type' => CRM_Utils_Type::T_BOOLEAN,
692 'title' => ts('Record Activity for Reminder?'),
693 'description' => ts('Record Activity for this reminder?'),
694 'where' => 'civicrm_action_schedule.record_activity',
695 'default' => 'NULL',
696 'table_name' => 'civicrm_action_schedule',
697 'entity' => 'ActionSchedule',
698 'bao' => 'CRM_Core_BAO_ActionSchedule',
699 'localizable' => 0,
700 'add' => '3.4',
701 ],
702 'mapping_id' => [
703 'name' => 'mapping_id',
704 'type' => CRM_Utils_Type::T_STRING,
705 'title' => ts('Reminder Mapping'),
706 'description' => ts('Name/ID of the mapping to use on this table'),
707 'maxlength' => 64,
708 'size' => CRM_Utils_Type::BIG,
709 'where' => 'civicrm_action_schedule.mapping_id',
710 'table_name' => 'civicrm_action_schedule',
711 'entity' => 'ActionSchedule',
712 'bao' => 'CRM_Core_BAO_ActionSchedule',
713 'localizable' => 0,
714 'add' => '3.4',
715 ],
716 'group_id' => [
717 'name' => 'group_id',
718 'type' => CRM_Utils_Type::T_INT,
719 'title' => ts('Reminder Group'),
720 'description' => ts('FK to Group'),
721 'where' => 'civicrm_action_schedule.group_id',
722 'table_name' => 'civicrm_action_schedule',
723 'entity' => 'ActionSchedule',
724 'bao' => 'CRM_Core_BAO_ActionSchedule',
725 'localizable' => 0,
726 'FKClassName' => 'CRM_Contact_DAO_Group',
727 'html' => [
728 'type' => 'Select',
729 ],
730 'pseudoconstant' => [
731 'table' => 'civicrm_group',
732 'keyColumn' => 'id',
733 'labelColumn' => 'title',
734 ],
735 'add' => '3.4',
736 ],
737 'msg_template_id' => [
738 'name' => 'msg_template_id',
739 'type' => CRM_Utils_Type::T_INT,
740 'title' => ts('Reminder Template'),
741 'description' => ts('FK to the message template.'),
742 'where' => 'civicrm_action_schedule.msg_template_id',
743 'table_name' => 'civicrm_action_schedule',
744 'entity' => 'ActionSchedule',
745 'bao' => 'CRM_Core_BAO_ActionSchedule',
746 'localizable' => 0,
747 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
748 'add' => NULL,
749 ],
750 'sms_template_id' => [
751 'name' => 'sms_template_id',
752 'type' => CRM_Utils_Type::T_INT,
753 'title' => ts('SMS Reminder Template'),
754 'description' => ts('FK to the message template.'),
755 'where' => 'civicrm_action_schedule.sms_template_id',
756 'table_name' => 'civicrm_action_schedule',
757 'entity' => 'ActionSchedule',
758 'bao' => 'CRM_Core_BAO_ActionSchedule',
759 'localizable' => 0,
760 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
761 'add' => NULL,
762 ],
763 'absolute_date' => [
764 'name' => 'absolute_date',
765 'type' => CRM_Utils_Type::T_DATE,
766 'title' => ts('Fixed Date for Reminder'),
767 'description' => ts('Date on which the reminder be sent.'),
768 'where' => 'civicrm_action_schedule.absolute_date',
769 'table_name' => 'civicrm_action_schedule',
770 'entity' => 'ActionSchedule',
771 'bao' => 'CRM_Core_BAO_ActionSchedule',
772 'localizable' => 0,
773 'add' => '4.1',
774 ],
775 'from_name' => [
776 'name' => 'from_name',
777 'type' => CRM_Utils_Type::T_STRING,
778 'title' => ts('Reminder from Name'),
779 'description' => ts('Name in "from" field'),
780 'maxlength' => 255,
781 'size' => CRM_Utils_Type::HUGE,
782 'where' => 'civicrm_action_schedule.from_name',
783 'table_name' => 'civicrm_action_schedule',
784 'entity' => 'ActionSchedule',
785 'bao' => 'CRM_Core_BAO_ActionSchedule',
786 'localizable' => 0,
787 'add' => '4.5',
788 ],
789 'from_email' => [
790 'name' => 'from_email',
791 'type' => CRM_Utils_Type::T_STRING,
792 'title' => ts('Reminder From Email'),
793 'description' => ts('Email address in "from" field'),
794 'maxlength' => 255,
795 'size' => CRM_Utils_Type::HUGE,
796 'where' => 'civicrm_action_schedule.from_email',
797 'table_name' => 'civicrm_action_schedule',
798 'entity' => 'ActionSchedule',
799 'bao' => 'CRM_Core_BAO_ActionSchedule',
800 'localizable' => 0,
801 'add' => '4.5',
802 ],
803 'mode' => [
804 'name' => 'mode',
805 'type' => CRM_Utils_Type::T_STRING,
806 'title' => ts('Message Mode'),
807 'description' => ts('Send the message as email or sms or both.'),
808 'maxlength' => 128,
809 'size' => CRM_Utils_Type::HUGE,
810 'where' => 'civicrm_action_schedule.mode',
811 'default' => 'Email',
812 'table_name' => 'civicrm_action_schedule',
813 'entity' => 'ActionSchedule',
814 'bao' => 'CRM_Core_BAO_ActionSchedule',
815 'localizable' => 0,
816 'html' => [
817 'type' => 'Select',
818 ],
819 'pseudoconstant' => [
820 'optionGroupName' => 'msg_mode',
821 'optionEditPath' => 'civicrm/admin/options/msg_mode',
822 ],
823 'add' => '4.5',
824 ],
825 'sms_provider_id' => [
826 'name' => 'sms_provider_id',
827 'type' => CRM_Utils_Type::T_INT,
828 'title' => ts('SMS Provider'),
829 'where' => 'civicrm_action_schedule.sms_provider_id',
830 'table_name' => 'civicrm_action_schedule',
831 'entity' => 'ActionSchedule',
832 'bao' => 'CRM_Core_BAO_ActionSchedule',
833 'localizable' => 0,
834 'FKClassName' => 'CRM_SMS_DAO_Provider',
835 'html' => [
836 'type' => 'Select',
837 ],
838 'add' => '4.5',
839 ],
840 'used_for' => [
841 'name' => 'used_for',
842 'type' => CRM_Utils_Type::T_STRING,
843 'title' => ts('Used For'),
844 'description' => ts('Used for repeating entity'),
845 'maxlength' => 64,
846 'size' => CRM_Utils_Type::BIG,
847 'where' => 'civicrm_action_schedule.used_for',
848 'table_name' => 'civicrm_action_schedule',
849 'entity' => 'ActionSchedule',
850 'bao' => 'CRM_Core_BAO_ActionSchedule',
851 'localizable' => 0,
852 'add' => '4.6',
853 ],
854 'filter_contact_language' => [
855 'name' => 'filter_contact_language',
856 'type' => CRM_Utils_Type::T_STRING,
857 'title' => ts('Filter Contact Language'),
858 'description' => ts('Used for multilingual installation'),
859 'maxlength' => 128,
860 'size' => CRM_Utils_Type::HUGE,
861 'where' => 'civicrm_action_schedule.filter_contact_language',
862 'table_name' => 'civicrm_action_schedule',
863 'entity' => 'ActionSchedule',
864 'bao' => 'CRM_Core_BAO_ActionSchedule',
865 'localizable' => 0,
866 'add' => '4.7',
867 ],
868 'communication_language' => [
869 'name' => 'communication_language',
870 'type' => CRM_Utils_Type::T_STRING,
871 'title' => ts('Communication Language'),
872 'description' => ts('Used for multilingual installation'),
873 'maxlength' => 8,
874 'size' => CRM_Utils_Type::EIGHT,
875 'where' => 'civicrm_action_schedule.communication_language',
876 'table_name' => 'civicrm_action_schedule',
877 'entity' => 'ActionSchedule',
878 'bao' => 'CRM_Core_BAO_ActionSchedule',
879 'localizable' => 0,
880 'add' => '4.7',
881 ],
882 ];
883 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
884 }
885 return Civi::$statics[__CLASS__]['fields'];
886 }
887
888 /**
889 * Return a mapping from field-name to the corresponding key (as used in fields()).
890 *
891 * @return array
892 * Array(string $name => string $uniqueName).
893 */
894 public static function &fieldKeys() {
895 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
896 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
897 }
898 return Civi::$statics[__CLASS__]['fieldKeys'];
899 }
900
901 /**
902 * Returns the names of this table
903 *
904 * @return string
905 */
906 public static function getTableName() {
907 return self::$_tableName;
908 }
909
910 /**
911 * Returns if this table needs to be logged
912 *
913 * @return bool
914 */
915 public function getLog() {
916 return self::$_log;
917 }
918
919 /**
920 * Returns the list of fields that can be imported
921 *
922 * @param bool $prefix
923 *
924 * @return array
925 */
926 public static function &import($prefix = FALSE) {
927 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_schedule', $prefix, []);
928 return $r;
929 }
930
931 /**
932 * Returns the list of fields that can be exported
933 *
934 * @param bool $prefix
935 *
936 * @return array
937 */
938 public static function &export($prefix = FALSE) {
939 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_schedule', $prefix, []);
940 return $r;
941 }
942
943 /**
944 * Returns the list of indices
945 *
946 * @param bool $localize
947 *
948 * @return array
949 */
950 public static function indices($localize = TRUE) {
951 $indices = [];
952 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
953 }
954
955 }