Merge pull request #22631 from braders/calculateBaseScheduleDate-docblock
[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:ea596948c02894437bcc1a3f5b5c4f9d)
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|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
37 */
38 public $id;
39
40 /**
41 * Name of the action(reminder)
42 *
43 * @var string|null
44 * (SQL type: varchar(64))
45 * Note that values will be retrieved from the database as a string.
46 */
47 public $name;
48
49 /**
50 * Title of the action(reminder)
51 *
52 * @var string|null
53 * (SQL type: varchar(64))
54 * Note that values will be retrieved from the database as a string.
55 */
56 public $title;
57
58 /**
59 * Recipient
60 *
61 * @var string|null
62 * (SQL type: varchar(64))
63 * Note that values will be retrieved from the database as a string.
64 */
65 public $recipient;
66
67 /**
68 * Is this the recipient criteria limited to OR in addition to?
69 *
70 * @var bool|string|null
71 * (SQL type: tinyint)
72 * Note that values will be retrieved from the database as a string.
73 */
74 public $limit_to;
75
76 /**
77 * Entity value
78 *
79 * @var string|null
80 * (SQL type: varchar(255))
81 * Note that values will be retrieved from the database as a string.
82 */
83 public $entity_value;
84
85 /**
86 * Entity status
87 *
88 * @var string|null
89 * (SQL type: varchar(64))
90 * Note that values will be retrieved from the database as a string.
91 */
92 public $entity_status;
93
94 /**
95 * Reminder Interval.
96 *
97 * @var int|string|null
98 * (SQL type: int unsigned)
99 * Note that values will be retrieved from the database as a string.
100 */
101 public $start_action_offset;
102
103 /**
104 * Time units for reminder.
105 *
106 * @var string|null
107 * (SQL type: varchar(8))
108 * Note that values will be retrieved from the database as a string.
109 */
110 public $start_action_unit;
111
112 /**
113 * Reminder Action
114 *
115 * @var string|null
116 * (SQL type: varchar(64))
117 * Note that values will be retrieved from the database as a string.
118 */
119 public $start_action_condition;
120
121 /**
122 * Entity date
123 *
124 * @var string|null
125 * (SQL type: varchar(64))
126 * Note that values will be retrieved from the database as a string.
127 */
128 public $start_action_date;
129
130 /**
131 * @var bool|string|null
132 * (SQL type: tinyint)
133 * Note that values will be retrieved from the database as a string.
134 */
135 public $is_repeat;
136
137 /**
138 * Time units for repetition of reminder.
139 *
140 * @var string|null
141 * (SQL type: varchar(8))
142 * Note that values will be retrieved from the database as a string.
143 */
144 public $repetition_frequency_unit;
145
146 /**
147 * Time interval for repeating the reminder.
148 *
149 * @var int|string|null
150 * (SQL type: int unsigned)
151 * Note that values will be retrieved from the database as a string.
152 */
153 public $repetition_frequency_interval;
154
155 /**
156 * Time units till repetition of reminder.
157 *
158 * @var string|null
159 * (SQL type: varchar(8))
160 * Note that values will be retrieved from the database as a string.
161 */
162 public $end_frequency_unit;
163
164 /**
165 * Time interval till repeating the reminder.
166 *
167 * @var int|string|null
168 * (SQL type: int unsigned)
169 * Note that values will be retrieved from the database as a string.
170 */
171 public $end_frequency_interval;
172
173 /**
174 * Reminder Action till repeating the reminder.
175 *
176 * @var string|null
177 * (SQL type: varchar(32))
178 * Note that values will be retrieved from the database as a string.
179 */
180 public $end_action;
181
182 /**
183 * Entity end date
184 *
185 * @var string|null
186 * (SQL type: varchar(64))
187 * Note that values will be retrieved from the database as a string.
188 */
189 public $end_date;
190
191 /**
192 * Is this option active?
193 *
194 * @var bool|string|null
195 * (SQL type: tinyint)
196 * Note that values will be retrieved from the database as a string.
197 */
198 public $is_active;
199
200 /**
201 * Contact IDs to which reminder should be sent.
202 *
203 * @var string|null
204 * (SQL type: varchar(128))
205 * Note that values will be retrieved from the database as a string.
206 */
207 public $recipient_manual;
208
209 /**
210 * listing based on recipient field.
211 *
212 * @var string|null
213 * (SQL type: varchar(128))
214 * Note that values will be retrieved from the database as a string.
215 */
216 public $recipient_listing;
217
218 /**
219 * Body of the mailing in text format.
220 *
221 * @var string|null
222 * (SQL type: longtext)
223 * Note that values will be retrieved from the database as a string.
224 */
225 public $body_text;
226
227 /**
228 * Body of the mailing in html format.
229 *
230 * @var string|null
231 * (SQL type: longtext)
232 * Note that values will be retrieved from the database as a string.
233 */
234 public $body_html;
235
236 /**
237 * Content of the SMS text.
238 *
239 * @var string|null
240 * (SQL type: longtext)
241 * Note that values will be retrieved from the database as a string.
242 */
243 public $sms_body_text;
244
245 /**
246 * Subject of mailing
247 *
248 * @var string|null
249 * (SQL type: varchar(128))
250 * Note that values will be retrieved from the database as a string.
251 */
252 public $subject;
253
254 /**
255 * Record Activity for this reminder?
256 *
257 * @var bool|string|null
258 * (SQL type: tinyint)
259 * Note that values will be retrieved from the database as a string.
260 */
261 public $record_activity;
262
263 /**
264 * Name/ID of the mapping to use on this table
265 *
266 * @var string|null
267 * (SQL type: varchar(64))
268 * Note that values will be retrieved from the database as a string.
269 */
270 public $mapping_id;
271
272 /**
273 * FK to Group
274 *
275 * @var int|string|null
276 * (SQL type: int unsigned)
277 * Note that values will be retrieved from the database as a string.
278 */
279 public $group_id;
280
281 /**
282 * FK to the message template.
283 *
284 * @var int|string|null
285 * (SQL type: int unsigned)
286 * Note that values will be retrieved from the database as a string.
287 */
288 public $msg_template_id;
289
290 /**
291 * FK to the message template.
292 *
293 * @var int|string|null
294 * (SQL type: int unsigned)
295 * Note that values will be retrieved from the database as a string.
296 */
297 public $sms_template_id;
298
299 /**
300 * Date on which the reminder be sent.
301 *
302 * @var string|null
303 * (SQL type: date)
304 * Note that values will be retrieved from the database as a string.
305 */
306 public $absolute_date;
307
308 /**
309 * Name in "from" field
310 *
311 * @var string|null
312 * (SQL type: varchar(255))
313 * Note that values will be retrieved from the database as a string.
314 */
315 public $from_name;
316
317 /**
318 * Email address in "from" field
319 *
320 * @var string|null
321 * (SQL type: varchar(255))
322 * Note that values will be retrieved from the database as a string.
323 */
324 public $from_email;
325
326 /**
327 * Send the message as email or sms or both.
328 *
329 * @var string|null
330 * (SQL type: varchar(128))
331 * Note that values will be retrieved from the database as a string.
332 */
333 public $mode;
334
335 /**
336 * @var int|string|null
337 * (SQL type: int unsigned)
338 * Note that values will be retrieved from the database as a string.
339 */
340 public $sms_provider_id;
341
342 /**
343 * Used for repeating entity
344 *
345 * @var string|null
346 * (SQL type: varchar(64))
347 * Note that values will be retrieved from the database as a string.
348 */
349 public $used_for;
350
351 /**
352 * Used for multilingual installation
353 *
354 * @var string|null
355 * (SQL type: varchar(128))
356 * Note that values will be retrieved from the database as a string.
357 */
358 public $filter_contact_language;
359
360 /**
361 * Used for multilingual installation
362 *
363 * @var string|null
364 * (SQL type: varchar(8))
365 * Note that values will be retrieved from the database as a string.
366 */
367 public $communication_language;
368
369 /**
370 * When was the scheduled reminder created.
371 *
372 * @var string
373 * (SQL type: timestamp)
374 * Note that values will be retrieved from the database as a string.
375 */
376 public $created_date;
377
378 /**
379 * When the reminder was created or modified.
380 *
381 * @var string
382 * (SQL type: timestamp)
383 * Note that values will be retrieved from the database as a string.
384 */
385 public $modified_date;
386
387 /**
388 * Earliest date to consider start events from.
389 *
390 * @var string
391 * (SQL type: timestamp)
392 * Note that values will be retrieved from the database as a string.
393 */
394 public $effective_start_date;
395
396 /**
397 * Latest date to consider end events from.
398 *
399 * @var string
400 * (SQL type: timestamp)
401 * Note that values will be retrieved from the database as a string.
402 */
403 public $effective_end_date;
404
405 /**
406 * Class constructor.
407 */
408 public function __construct() {
409 $this->__table = 'civicrm_action_schedule';
410 parent::__construct();
411 }
412
413 /**
414 * Returns localized title of this entity.
415 *
416 * @param bool $plural
417 * Whether to return the plural version of the title.
418 */
419 public static function getEntityTitle($plural = FALSE) {
420 return $plural ? ts('Action Schedules') : ts('Action Schedule');
421 }
422
423 /**
424 * Returns foreign keys and entity references.
425 *
426 * @return array
427 * [CRM_Core_Reference_Interface]
428 */
429 public static function getReferenceColumns() {
430 if (!isset(Civi::$statics[__CLASS__]['links'])) {
431 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
432 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'group_id', 'civicrm_group', 'id');
433 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id');
434 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'sms_template_id', 'civicrm_msg_template', 'id');
435 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id');
436 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
437 }
438 return Civi::$statics[__CLASS__]['links'];
439 }
440
441 /**
442 * Returns all the column names of this table
443 *
444 * @return array
445 */
446 public static function &fields() {
447 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
448 Civi::$statics[__CLASS__]['fields'] = [
449 'id' => [
450 'name' => 'id',
451 'type' => CRM_Utils_Type::T_INT,
452 'title' => ts('Action Schedule ID'),
453 'required' => TRUE,
454 'where' => 'civicrm_action_schedule.id',
455 'table_name' => 'civicrm_action_schedule',
456 'entity' => 'ActionSchedule',
457 'bao' => 'CRM_Core_BAO_ActionSchedule',
458 'localizable' => 0,
459 'html' => [
460 'type' => 'Number',
461 ],
462 'readonly' => TRUE,
463 'add' => '3.4',
464 ],
465 'name' => [
466 'name' => 'name',
467 'type' => CRM_Utils_Type::T_STRING,
468 'title' => ts('Name'),
469 'description' => ts('Name of the action(reminder)'),
470 'maxlength' => 64,
471 'size' => CRM_Utils_Type::BIG,
472 'where' => 'civicrm_action_schedule.name',
473 'table_name' => 'civicrm_action_schedule',
474 'entity' => 'ActionSchedule',
475 'bao' => 'CRM_Core_BAO_ActionSchedule',
476 'localizable' => 0,
477 'add' => '3.4',
478 ],
479 'title' => [
480 'name' => 'title',
481 'type' => CRM_Utils_Type::T_STRING,
482 'title' => ts('Title'),
483 'description' => ts('Title of the action(reminder)'),
484 'maxlength' => 64,
485 'size' => CRM_Utils_Type::BIG,
486 'where' => 'civicrm_action_schedule.title',
487 'table_name' => 'civicrm_action_schedule',
488 'entity' => 'ActionSchedule',
489 'bao' => 'CRM_Core_BAO_ActionSchedule',
490 'localizable' => 0,
491 'add' => '3.4',
492 ],
493 'recipient' => [
494 'name' => 'recipient',
495 'type' => CRM_Utils_Type::T_STRING,
496 'title' => ts('Recipient'),
497 'description' => ts('Recipient'),
498 'maxlength' => 64,
499 'size' => CRM_Utils_Type::BIG,
500 'where' => 'civicrm_action_schedule.recipient',
501 'table_name' => 'civicrm_action_schedule',
502 'entity' => 'ActionSchedule',
503 'bao' => 'CRM_Core_BAO_ActionSchedule',
504 'localizable' => 0,
505 'html' => [
506 'label' => ts("Recipient"),
507 ],
508 'add' => '3.4',
509 ],
510 'limit_to' => [
511 'name' => 'limit_to',
512 'type' => CRM_Utils_Type::T_BOOLEAN,
513 'title' => ts('Limit To'),
514 'description' => ts('Is this the recipient criteria limited to OR in addition to?'),
515 'where' => 'civicrm_action_schedule.limit_to',
516 'table_name' => 'civicrm_action_schedule',
517 'entity' => 'ActionSchedule',
518 'bao' => 'CRM_Core_BAO_ActionSchedule',
519 'localizable' => 0,
520 'html' => [
521 'label' => ts("Limit To"),
522 ],
523 'add' => '4.4',
524 ],
525 'entity_value' => [
526 'name' => 'entity_value',
527 'type' => CRM_Utils_Type::T_STRING,
528 'title' => ts('Entity Value'),
529 'description' => ts('Entity value'),
530 'maxlength' => 255,
531 'size' => CRM_Utils_Type::HUGE,
532 'where' => 'civicrm_action_schedule.entity_value',
533 'table_name' => 'civicrm_action_schedule',
534 'entity' => 'ActionSchedule',
535 'bao' => 'CRM_Core_BAO_ActionSchedule',
536 'localizable' => 0,
537 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
538 'html' => [
539 'label' => ts("Entity value"),
540 ],
541 'add' => '3.4',
542 ],
543 'entity_status' => [
544 'name' => 'entity_status',
545 'type' => CRM_Utils_Type::T_STRING,
546 'title' => ts('Entity Status'),
547 'description' => ts('Entity status'),
548 'maxlength' => 64,
549 'size' => CRM_Utils_Type::BIG,
550 'where' => 'civicrm_action_schedule.entity_status',
551 'table_name' => 'civicrm_action_schedule',
552 'entity' => 'ActionSchedule',
553 'bao' => 'CRM_Core_BAO_ActionSchedule',
554 'localizable' => 0,
555 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
556 'html' => [
557 'label' => ts("Entity Status"),
558 ],
559 'add' => '3.4',
560 ],
561 'start_action_offset' => [
562 'name' => 'start_action_offset',
563 'type' => CRM_Utils_Type::T_INT,
564 'title' => ts('Start Action Offset'),
565 'description' => ts('Reminder Interval.'),
566 'where' => 'civicrm_action_schedule.start_action_offset',
567 'default' => '0',
568 'table_name' => 'civicrm_action_schedule',
569 'entity' => 'ActionSchedule',
570 'bao' => 'CRM_Core_BAO_ActionSchedule',
571 'localizable' => 0,
572 'html' => [
573 'label' => ts("Start Action Offset"),
574 ],
575 'add' => '3.4',
576 ],
577 'start_action_unit' => [
578 'name' => 'start_action_unit',
579 'type' => CRM_Utils_Type::T_STRING,
580 'title' => ts('Start Action Unit'),
581 'description' => ts('Time units for reminder.'),
582 'maxlength' => 8,
583 'size' => CRM_Utils_Type::EIGHT,
584 'where' => 'civicrm_action_schedule.start_action_unit',
585 'table_name' => 'civicrm_action_schedule',
586 'entity' => 'ActionSchedule',
587 'bao' => 'CRM_Core_BAO_ActionSchedule',
588 'localizable' => 0,
589 'html' => [
590 'type' => 'Select',
591 'label' => ts("Start Action Unit"),
592 ],
593 'pseudoconstant' => [
594 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
595 ],
596 'add' => '3.4',
597 ],
598 'start_action_condition' => [
599 'name' => 'start_action_condition',
600 'type' => CRM_Utils_Type::T_STRING,
601 'title' => ts('Start Action Condition'),
602 'description' => ts('Reminder Action'),
603 'maxlength' => 64,
604 'size' => CRM_Utils_Type::BIG,
605 'where' => 'civicrm_action_schedule.start_action_condition',
606 'table_name' => 'civicrm_action_schedule',
607 'entity' => 'ActionSchedule',
608 'bao' => 'CRM_Core_BAO_ActionSchedule',
609 'localizable' => 0,
610 'html' => [
611 'label' => ts("Start Action condition"),
612 ],
613 'add' => '3.4',
614 ],
615 'start_action_date' => [
616 'name' => 'start_action_date',
617 'type' => CRM_Utils_Type::T_STRING,
618 'title' => ts('Start Action Date'),
619 'description' => ts('Entity date'),
620 'maxlength' => 64,
621 'size' => CRM_Utils_Type::BIG,
622 'where' => 'civicrm_action_schedule.start_action_date',
623 'table_name' => 'civicrm_action_schedule',
624 'entity' => 'ActionSchedule',
625 'bao' => 'CRM_Core_BAO_ActionSchedule',
626 'localizable' => 0,
627 'html' => [
628 'label' => ts("Start Action Date"),
629 ],
630 'add' => '3.4',
631 ],
632 'is_repeat' => [
633 'name' => 'is_repeat',
634 'type' => CRM_Utils_Type::T_BOOLEAN,
635 'title' => ts('Repeat?'),
636 'where' => 'civicrm_action_schedule.is_repeat',
637 'default' => '0',
638 'table_name' => 'civicrm_action_schedule',
639 'entity' => 'ActionSchedule',
640 'bao' => 'CRM_Core_BAO_ActionSchedule',
641 'localizable' => 0,
642 'add' => '3.4',
643 ],
644 'repetition_frequency_unit' => [
645 'name' => 'repetition_frequency_unit',
646 'type' => CRM_Utils_Type::T_STRING,
647 'title' => ts('Repetition Frequency Unit'),
648 'description' => ts('Time units for repetition of reminder.'),
649 'maxlength' => 8,
650 'size' => CRM_Utils_Type::EIGHT,
651 'where' => 'civicrm_action_schedule.repetition_frequency_unit',
652 'table_name' => 'civicrm_action_schedule',
653 'entity' => 'ActionSchedule',
654 'bao' => 'CRM_Core_BAO_ActionSchedule',
655 'localizable' => 0,
656 'html' => [
657 'type' => 'Select',
658 'label' => ts("Repetition Frequency Unit"),
659 ],
660 'pseudoconstant' => [
661 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
662 ],
663 'add' => '3.4',
664 ],
665 'repetition_frequency_interval' => [
666 'name' => 'repetition_frequency_interval',
667 'type' => CRM_Utils_Type::T_INT,
668 'title' => ts('Repetition Frequency Interval'),
669 'description' => ts('Time interval for repeating the reminder.'),
670 'where' => 'civicrm_action_schedule.repetition_frequency_interval',
671 'default' => '0',
672 'table_name' => 'civicrm_action_schedule',
673 'entity' => 'ActionSchedule',
674 'bao' => 'CRM_Core_BAO_ActionSchedule',
675 'localizable' => 0,
676 'html' => [
677 'label' => ts("Repetition Frequency Interval"),
678 ],
679 'add' => '3.4',
680 ],
681 'end_frequency_unit' => [
682 'name' => 'end_frequency_unit',
683 'type' => CRM_Utils_Type::T_STRING,
684 'title' => ts('End Frequency Unit'),
685 'description' => ts('Time units till repetition of reminder.'),
686 'maxlength' => 8,
687 'size' => CRM_Utils_Type::EIGHT,
688 'where' => 'civicrm_action_schedule.end_frequency_unit',
689 'table_name' => 'civicrm_action_schedule',
690 'entity' => 'ActionSchedule',
691 'bao' => 'CRM_Core_BAO_ActionSchedule',
692 'localizable' => 0,
693 'html' => [
694 'type' => 'Select',
695 'label' => ts("End Frequency Unit"),
696 ],
697 'pseudoconstant' => [
698 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
699 ],
700 'add' => '3.4',
701 ],
702 'end_frequency_interval' => [
703 'name' => 'end_frequency_interval',
704 'type' => CRM_Utils_Type::T_INT,
705 'title' => ts('End Frequency Interval'),
706 'description' => ts('Time interval till repeating the reminder.'),
707 'where' => 'civicrm_action_schedule.end_frequency_interval',
708 'default' => '0',
709 'table_name' => 'civicrm_action_schedule',
710 'entity' => 'ActionSchedule',
711 'bao' => 'CRM_Core_BAO_ActionSchedule',
712 'localizable' => 0,
713 'html' => [
714 'label' => ts("End Frequency Interval"),
715 ],
716 'add' => '3.4',
717 ],
718 'end_action' => [
719 'name' => 'end_action',
720 'type' => CRM_Utils_Type::T_STRING,
721 'title' => ts('End Action'),
722 'description' => ts('Reminder Action till repeating the reminder.'),
723 'maxlength' => 32,
724 'size' => CRM_Utils_Type::MEDIUM,
725 'where' => 'civicrm_action_schedule.end_action',
726 'table_name' => 'civicrm_action_schedule',
727 'entity' => 'ActionSchedule',
728 'bao' => 'CRM_Core_BAO_ActionSchedule',
729 'localizable' => 0,
730 'html' => [
731 'label' => ts("End Action"),
732 ],
733 'add' => '3.4',
734 ],
735 'end_date' => [
736 'name' => 'end_date',
737 'type' => CRM_Utils_Type::T_STRING,
738 'title' => ts('End Date'),
739 'description' => ts('Entity end date'),
740 'maxlength' => 64,
741 'size' => CRM_Utils_Type::BIG,
742 'where' => 'civicrm_action_schedule.end_date',
743 'table_name' => 'civicrm_action_schedule',
744 'entity' => 'ActionSchedule',
745 'bao' => 'CRM_Core_BAO_ActionSchedule',
746 'localizable' => 0,
747 'html' => [
748 'label' => ts("End Date"),
749 ],
750 'add' => '3.4',
751 ],
752 'is_active' => [
753 'name' => 'is_active',
754 'type' => CRM_Utils_Type::T_BOOLEAN,
755 'title' => ts('Schedule is Active?'),
756 'description' => ts('Is this option active?'),
757 'where' => 'civicrm_action_schedule.is_active',
758 'default' => '1',
759 'table_name' => 'civicrm_action_schedule',
760 'entity' => 'ActionSchedule',
761 'bao' => 'CRM_Core_BAO_ActionSchedule',
762 'localizable' => 0,
763 'add' => '3.4',
764 ],
765 'recipient_manual' => [
766 'name' => 'recipient_manual',
767 'type' => CRM_Utils_Type::T_STRING,
768 'title' => ts('Recipient Manual'),
769 'description' => ts('Contact IDs to which reminder should be sent.'),
770 'maxlength' => 128,
771 'size' => CRM_Utils_Type::HUGE,
772 'where' => 'civicrm_action_schedule.recipient_manual',
773 'table_name' => 'civicrm_action_schedule',
774 'entity' => 'ActionSchedule',
775 'bao' => 'CRM_Core_BAO_ActionSchedule',
776 'localizable' => 0,
777 'serialize' => self::SERIALIZE_COMMA,
778 'add' => '3.4',
779 ],
780 'recipient_listing' => [
781 'name' => 'recipient_listing',
782 'type' => CRM_Utils_Type::T_STRING,
783 'title' => ts('Recipient Listing'),
784 'description' => ts('listing based on recipient field.'),
785 'maxlength' => 128,
786 'size' => CRM_Utils_Type::HUGE,
787 'where' => 'civicrm_action_schedule.recipient_listing',
788 'table_name' => 'civicrm_action_schedule',
789 'entity' => 'ActionSchedule',
790 'bao' => 'CRM_Core_BAO_ActionSchedule',
791 'localizable' => 0,
792 'add' => '4.1',
793 ],
794 'body_text' => [
795 'name' => 'body_text',
796 'type' => CRM_Utils_Type::T_LONGTEXT,
797 'title' => ts('Reminder Text'),
798 'description' => ts('Body of the mailing in text format.'),
799 'where' => 'civicrm_action_schedule.body_text',
800 'table_name' => 'civicrm_action_schedule',
801 'entity' => 'ActionSchedule',
802 'bao' => 'CRM_Core_BAO_ActionSchedule',
803 'localizable' => 0,
804 'add' => '3.4',
805 ],
806 'body_html' => [
807 'name' => 'body_html',
808 'type' => CRM_Utils_Type::T_LONGTEXT,
809 'title' => ts('Reminder HTML'),
810 'description' => ts('Body of the mailing in html format.'),
811 'where' => 'civicrm_action_schedule.body_html',
812 'table_name' => 'civicrm_action_schedule',
813 'entity' => 'ActionSchedule',
814 'bao' => 'CRM_Core_BAO_ActionSchedule',
815 'localizable' => 0,
816 'add' => '3.4',
817 ],
818 'sms_body_text' => [
819 'name' => 'sms_body_text',
820 'type' => CRM_Utils_Type::T_LONGTEXT,
821 'title' => ts('SMS Reminder Text'),
822 'description' => ts('Content of the SMS text.'),
823 'where' => 'civicrm_action_schedule.sms_body_text',
824 'table_name' => 'civicrm_action_schedule',
825 'entity' => 'ActionSchedule',
826 'bao' => 'CRM_Core_BAO_ActionSchedule',
827 'localizable' => 0,
828 'add' => '4.5',
829 ],
830 'subject' => [
831 'name' => 'subject',
832 'type' => CRM_Utils_Type::T_STRING,
833 'title' => ts('Reminder Subject'),
834 'description' => ts('Subject of mailing'),
835 'maxlength' => 128,
836 'size' => CRM_Utils_Type::HUGE,
837 'where' => 'civicrm_action_schedule.subject',
838 'table_name' => 'civicrm_action_schedule',
839 'entity' => 'ActionSchedule',
840 'bao' => 'CRM_Core_BAO_ActionSchedule',
841 'localizable' => 0,
842 'add' => '3.4',
843 ],
844 'record_activity' => [
845 'name' => 'record_activity',
846 'type' => CRM_Utils_Type::T_BOOLEAN,
847 'title' => ts('Record Activity for Reminder?'),
848 'description' => ts('Record Activity for this reminder?'),
849 'where' => 'civicrm_action_schedule.record_activity',
850 'default' => NULL,
851 'table_name' => 'civicrm_action_schedule',
852 'entity' => 'ActionSchedule',
853 'bao' => 'CRM_Core_BAO_ActionSchedule',
854 'localizable' => 0,
855 'add' => '3.4',
856 ],
857 'mapping_id' => [
858 'name' => 'mapping_id',
859 'type' => CRM_Utils_Type::T_STRING,
860 'title' => ts('Reminder Mapping'),
861 'description' => ts('Name/ID of the mapping to use on this table'),
862 'maxlength' => 64,
863 'size' => CRM_Utils_Type::BIG,
864 'where' => 'civicrm_action_schedule.mapping_id',
865 'table_name' => 'civicrm_action_schedule',
866 'entity' => 'ActionSchedule',
867 'bao' => 'CRM_Core_BAO_ActionSchedule',
868 'localizable' => 0,
869 'add' => '3.4',
870 ],
871 'group_id' => [
872 'name' => 'group_id',
873 'type' => CRM_Utils_Type::T_INT,
874 'title' => ts('Group ID'),
875 'description' => ts('FK to Group'),
876 'where' => 'civicrm_action_schedule.group_id',
877 'table_name' => 'civicrm_action_schedule',
878 'entity' => 'ActionSchedule',
879 'bao' => 'CRM_Core_BAO_ActionSchedule',
880 'localizable' => 0,
881 'FKClassName' => 'CRM_Contact_DAO_Group',
882 'html' => [
883 'type' => 'Select',
884 'label' => ts("Group"),
885 ],
886 'pseudoconstant' => [
887 'table' => 'civicrm_group',
888 'keyColumn' => 'id',
889 'labelColumn' => 'title',
890 ],
891 'add' => '3.4',
892 ],
893 'msg_template_id' => [
894 'name' => 'msg_template_id',
895 'type' => CRM_Utils_Type::T_INT,
896 'title' => ts('Message Template ID'),
897 'description' => ts('FK to the message template.'),
898 'where' => 'civicrm_action_schedule.msg_template_id',
899 'table_name' => 'civicrm_action_schedule',
900 'entity' => 'ActionSchedule',
901 'bao' => 'CRM_Core_BAO_ActionSchedule',
902 'localizable' => 0,
903 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
904 'html' => [
905 'label' => ts("Message Template"),
906 ],
907 'add' => NULL,
908 ],
909 'sms_template_id' => [
910 'name' => 'sms_template_id',
911 'type' => CRM_Utils_Type::T_INT,
912 'title' => ts('SMS Template ID'),
913 'description' => ts('FK to the message template.'),
914 'where' => 'civicrm_action_schedule.sms_template_id',
915 'table_name' => 'civicrm_action_schedule',
916 'entity' => 'ActionSchedule',
917 'bao' => 'CRM_Core_BAO_ActionSchedule',
918 'localizable' => 0,
919 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
920 'html' => [
921 'label' => ts("SMS Template"),
922 ],
923 'add' => NULL,
924 ],
925 'absolute_date' => [
926 'name' => 'absolute_date',
927 'type' => CRM_Utils_Type::T_DATE,
928 'title' => ts('Fixed Date for Reminder'),
929 'description' => ts('Date on which the reminder be sent.'),
930 'where' => 'civicrm_action_schedule.absolute_date',
931 'table_name' => 'civicrm_action_schedule',
932 'entity' => 'ActionSchedule',
933 'bao' => 'CRM_Core_BAO_ActionSchedule',
934 'localizable' => 0,
935 'add' => '4.1',
936 ],
937 'from_name' => [
938 'name' => 'from_name',
939 'type' => CRM_Utils_Type::T_STRING,
940 'title' => ts('Reminder from Name'),
941 'description' => ts('Name in "from" field'),
942 'maxlength' => 255,
943 'size' => CRM_Utils_Type::HUGE,
944 'where' => 'civicrm_action_schedule.from_name',
945 'table_name' => 'civicrm_action_schedule',
946 'entity' => 'ActionSchedule',
947 'bao' => 'CRM_Core_BAO_ActionSchedule',
948 'localizable' => 0,
949 'add' => '4.5',
950 ],
951 'from_email' => [
952 'name' => 'from_email',
953 'type' => CRM_Utils_Type::T_STRING,
954 'title' => ts('Reminder From Email'),
955 'description' => ts('Email address in "from" field'),
956 'maxlength' => 255,
957 'size' => CRM_Utils_Type::HUGE,
958 'where' => 'civicrm_action_schedule.from_email',
959 'table_name' => 'civicrm_action_schedule',
960 'entity' => 'ActionSchedule',
961 'bao' => 'CRM_Core_BAO_ActionSchedule',
962 'localizable' => 0,
963 'add' => '4.5',
964 ],
965 'mode' => [
966 'name' => 'mode',
967 'type' => CRM_Utils_Type::T_STRING,
968 'title' => ts('Message Mode'),
969 'description' => ts('Send the message as email or sms or both.'),
970 'maxlength' => 128,
971 'size' => CRM_Utils_Type::HUGE,
972 'where' => 'civicrm_action_schedule.mode',
973 'default' => 'Email',
974 'table_name' => 'civicrm_action_schedule',
975 'entity' => 'ActionSchedule',
976 'bao' => 'CRM_Core_BAO_ActionSchedule',
977 'localizable' => 0,
978 'html' => [
979 'type' => 'Select',
980 ],
981 'pseudoconstant' => [
982 'optionGroupName' => 'msg_mode',
983 'optionEditPath' => 'civicrm/admin/options/msg_mode',
984 ],
985 'add' => '4.5',
986 ],
987 'sms_provider_id' => [
988 'name' => 'sms_provider_id',
989 'type' => CRM_Utils_Type::T_INT,
990 'title' => ts('SMS Provider ID'),
991 'where' => 'civicrm_action_schedule.sms_provider_id',
992 'table_name' => 'civicrm_action_schedule',
993 'entity' => 'ActionSchedule',
994 'bao' => 'CRM_Core_BAO_ActionSchedule',
995 'localizable' => 0,
996 'FKClassName' => 'CRM_SMS_DAO_Provider',
997 'html' => [
998 'type' => 'Select',
999 'label' => ts("SMS Provider"),
1000 ],
1001 'add' => '4.5',
1002 ],
1003 'used_for' => [
1004 'name' => 'used_for',
1005 'type' => CRM_Utils_Type::T_STRING,
1006 'title' => ts('Used For'),
1007 'description' => ts('Used for repeating entity'),
1008 'maxlength' => 64,
1009 'size' => CRM_Utils_Type::BIG,
1010 'where' => 'civicrm_action_schedule.used_for',
1011 'table_name' => 'civicrm_action_schedule',
1012 'entity' => 'ActionSchedule',
1013 'bao' => 'CRM_Core_BAO_ActionSchedule',
1014 'localizable' => 0,
1015 'html' => [
1016 'label' => ts("Used For"),
1017 ],
1018 'add' => '4.6',
1019 ],
1020 'filter_contact_language' => [
1021 'name' => 'filter_contact_language',
1022 'type' => CRM_Utils_Type::T_STRING,
1023 'title' => ts('Filter Contact Language'),
1024 'description' => ts('Used for multilingual installation'),
1025 'maxlength' => 128,
1026 'size' => CRM_Utils_Type::HUGE,
1027 'where' => 'civicrm_action_schedule.filter_contact_language',
1028 'table_name' => 'civicrm_action_schedule',
1029 'entity' => 'ActionSchedule',
1030 'bao' => 'CRM_Core_BAO_ActionSchedule',
1031 'localizable' => 0,
1032 'html' => [
1033 'label' => ts("Filter Contact Language"),
1034 ],
1035 'add' => '4.7',
1036 ],
1037 'communication_language' => [
1038 'name' => 'communication_language',
1039 'type' => CRM_Utils_Type::T_STRING,
1040 'title' => ts('Communication Language'),
1041 'description' => ts('Used for multilingual installation'),
1042 'maxlength' => 8,
1043 'size' => CRM_Utils_Type::EIGHT,
1044 'where' => 'civicrm_action_schedule.communication_language',
1045 'table_name' => 'civicrm_action_schedule',
1046 'entity' => 'ActionSchedule',
1047 'bao' => 'CRM_Core_BAO_ActionSchedule',
1048 'localizable' => 0,
1049 'html' => [
1050 'label' => ts("Communication Language"),
1051 ],
1052 'add' => '4.7',
1053 ],
1054 'action_schedule_created_date' => [
1055 'name' => 'created_date',
1056 'type' => CRM_Utils_Type::T_TIMESTAMP,
1057 'title' => ts('Created Date'),
1058 'description' => ts('When was the scheduled reminder created.'),
1059 'required' => FALSE,
1060 'where' => 'civicrm_action_schedule.created_date',
1061 'export' => TRUE,
1062 'default' => 'CURRENT_TIMESTAMP',
1063 'table_name' => 'civicrm_action_schedule',
1064 'entity' => 'ActionSchedule',
1065 'bao' => 'CRM_Core_BAO_ActionSchedule',
1066 'localizable' => 0,
1067 'add' => '5.34',
1068 ],
1069 'modified_date' => [
1070 'name' => 'modified_date',
1071 'type' => CRM_Utils_Type::T_TIMESTAMP,
1072 'title' => ts('Modified Date'),
1073 'description' => ts('When the reminder was created or modified.'),
1074 'required' => FALSE,
1075 'where' => 'civicrm_action_schedule.modified_date',
1076 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
1077 'table_name' => 'civicrm_action_schedule',
1078 'entity' => 'ActionSchedule',
1079 'bao' => 'CRM_Core_BAO_ActionSchedule',
1080 'localizable' => 0,
1081 'html' => [
1082 'label' => ts("Modified Date"),
1083 ],
1084 'readonly' => TRUE,
1085 'add' => '5.34',
1086 ],
1087 'action_schedule_effective_start_date' => [
1088 'name' => 'effective_start_date',
1089 'type' => CRM_Utils_Type::T_TIMESTAMP,
1090 'title' => ts('Effective start date'),
1091 'description' => ts('Earliest date to consider start events from.'),
1092 'required' => FALSE,
1093 'where' => 'civicrm_action_schedule.effective_start_date',
1094 'export' => TRUE,
1095 'table_name' => 'civicrm_action_schedule',
1096 'entity' => 'ActionSchedule',
1097 'bao' => 'CRM_Core_BAO_ActionSchedule',
1098 'localizable' => 0,
1099 'add' => '5.34',
1100 ],
1101 'action_schedule_effective_end_date' => [
1102 'name' => 'effective_end_date',
1103 'type' => CRM_Utils_Type::T_TIMESTAMP,
1104 'title' => ts('Effective end date'),
1105 'description' => ts('Latest date to consider end events from.'),
1106 'required' => FALSE,
1107 'where' => 'civicrm_action_schedule.effective_end_date',
1108 'export' => TRUE,
1109 'table_name' => 'civicrm_action_schedule',
1110 'entity' => 'ActionSchedule',
1111 'bao' => 'CRM_Core_BAO_ActionSchedule',
1112 'localizable' => 0,
1113 'add' => '5.34',
1114 ],
1115 ];
1116 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
1117 }
1118 return Civi::$statics[__CLASS__]['fields'];
1119 }
1120
1121 /**
1122 * Return a mapping from field-name to the corresponding key (as used in fields()).
1123 *
1124 * @return array
1125 * Array(string $name => string $uniqueName).
1126 */
1127 public static function &fieldKeys() {
1128 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
1129 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
1130 }
1131 return Civi::$statics[__CLASS__]['fieldKeys'];
1132 }
1133
1134 /**
1135 * Returns the names of this table
1136 *
1137 * @return string
1138 */
1139 public static function getTableName() {
1140 return self::$_tableName;
1141 }
1142
1143 /**
1144 * Returns if this table needs to be logged
1145 *
1146 * @return bool
1147 */
1148 public function getLog() {
1149 return self::$_log;
1150 }
1151
1152 /**
1153 * Returns the list of fields that can be imported
1154 *
1155 * @param bool $prefix
1156 *
1157 * @return array
1158 */
1159 public static function &import($prefix = FALSE) {
1160 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_schedule', $prefix, []);
1161 return $r;
1162 }
1163
1164 /**
1165 * Returns the list of fields that can be exported
1166 *
1167 * @param bool $prefix
1168 *
1169 * @return array
1170 */
1171 public static function &export($prefix = FALSE) {
1172 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_schedule', $prefix, []);
1173 return $r;
1174 }
1175
1176 /**
1177 * Returns the list of indices
1178 *
1179 * @param bool $localize
1180 *
1181 * @return array
1182 */
1183 public static function indices($localize = TRUE) {
1184 $indices = [];
1185 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
1186 }
1187
1188 }