Merge pull request #23213 from eileenmcnaughton/post
[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:444acdd7b222ed9f593b0b84aebfb763)
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
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
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
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
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 'required' => TRUE,
516 'where' => 'civicrm_action_schedule.limit_to',
517 'default' => '1',
518 'table_name' => 'civicrm_action_schedule',
519 'entity' => 'ActionSchedule',
520 'bao' => 'CRM_Core_BAO_ActionSchedule',
521 'localizable' => 0,
522 'html' => [
523 'label' => ts("Limit To"),
524 ],
525 'add' => '4.4',
526 ],
527 'entity_value' => [
528 'name' => 'entity_value',
529 'type' => CRM_Utils_Type::T_STRING,
530 'title' => ts('Entity Value'),
531 'description' => ts('Entity value'),
532 'maxlength' => 255,
533 'size' => CRM_Utils_Type::HUGE,
534 'where' => 'civicrm_action_schedule.entity_value',
535 'table_name' => 'civicrm_action_schedule',
536 'entity' => 'ActionSchedule',
537 'bao' => 'CRM_Core_BAO_ActionSchedule',
538 'localizable' => 0,
539 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
540 'html' => [
541 'label' => ts("Entity value"),
542 ],
543 'add' => '3.4',
544 ],
545 'entity_status' => [
546 'name' => 'entity_status',
547 'type' => CRM_Utils_Type::T_STRING,
548 'title' => ts('Entity Status'),
549 'description' => ts('Entity status'),
550 'maxlength' => 64,
551 'size' => CRM_Utils_Type::BIG,
552 'where' => 'civicrm_action_schedule.entity_status',
553 'table_name' => 'civicrm_action_schedule',
554 'entity' => 'ActionSchedule',
555 'bao' => 'CRM_Core_BAO_ActionSchedule',
556 'localizable' => 0,
557 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
558 'html' => [
559 'label' => ts("Entity Status"),
560 ],
561 'add' => '3.4',
562 ],
563 'start_action_offset' => [
564 'name' => 'start_action_offset',
565 'type' => CRM_Utils_Type::T_INT,
566 'title' => ts('Start Action Offset'),
567 'description' => ts('Reminder Interval.'),
568 'where' => 'civicrm_action_schedule.start_action_offset',
569 'default' => '0',
570 'table_name' => 'civicrm_action_schedule',
571 'entity' => 'ActionSchedule',
572 'bao' => 'CRM_Core_BAO_ActionSchedule',
573 'localizable' => 0,
574 'html' => [
575 'label' => ts("Start Action Offset"),
576 ],
577 'add' => '3.4',
578 ],
579 'start_action_unit' => [
580 'name' => 'start_action_unit',
581 'type' => CRM_Utils_Type::T_STRING,
582 'title' => ts('Start Action Unit'),
583 'description' => ts('Time units for reminder.'),
584 'maxlength' => 8,
585 'size' => CRM_Utils_Type::EIGHT,
586 'where' => 'civicrm_action_schedule.start_action_unit',
587 'table_name' => 'civicrm_action_schedule',
588 'entity' => 'ActionSchedule',
589 'bao' => 'CRM_Core_BAO_ActionSchedule',
590 'localizable' => 0,
591 'html' => [
592 'type' => 'Select',
593 'label' => ts("Start Action Unit"),
594 ],
595 'pseudoconstant' => [
596 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
597 ],
598 'add' => '3.4',
599 ],
600 'start_action_condition' => [
601 'name' => 'start_action_condition',
602 'type' => CRM_Utils_Type::T_STRING,
603 'title' => ts('Start Action Condition'),
604 'description' => ts('Reminder Action'),
605 'maxlength' => 64,
606 'size' => CRM_Utils_Type::BIG,
607 'where' => 'civicrm_action_schedule.start_action_condition',
608 'table_name' => 'civicrm_action_schedule',
609 'entity' => 'ActionSchedule',
610 'bao' => 'CRM_Core_BAO_ActionSchedule',
611 'localizable' => 0,
612 'html' => [
613 'label' => ts("Start Action condition"),
614 ],
615 'add' => '3.4',
616 ],
617 'start_action_date' => [
618 'name' => 'start_action_date',
619 'type' => CRM_Utils_Type::T_STRING,
620 'title' => ts('Start Action Date'),
621 'description' => ts('Entity date'),
622 'maxlength' => 64,
623 'size' => CRM_Utils_Type::BIG,
624 'where' => 'civicrm_action_schedule.start_action_date',
625 'table_name' => 'civicrm_action_schedule',
626 'entity' => 'ActionSchedule',
627 'bao' => 'CRM_Core_BAO_ActionSchedule',
628 'localizable' => 0,
629 'html' => [
630 'label' => ts("Start Action Date"),
631 ],
632 'add' => '3.4',
633 ],
634 'is_repeat' => [
635 'name' => 'is_repeat',
636 'type' => CRM_Utils_Type::T_BOOLEAN,
637 'title' => ts('Repeat?'),
638 'required' => TRUE,
639 'where' => 'civicrm_action_schedule.is_repeat',
640 'default' => '0',
641 'table_name' => 'civicrm_action_schedule',
642 'entity' => 'ActionSchedule',
643 'bao' => 'CRM_Core_BAO_ActionSchedule',
644 'localizable' => 0,
645 'add' => '3.4',
646 ],
647 'repetition_frequency_unit' => [
648 'name' => 'repetition_frequency_unit',
649 'type' => CRM_Utils_Type::T_STRING,
650 'title' => ts('Repetition Frequency Unit'),
651 'description' => ts('Time units for repetition of reminder.'),
652 'maxlength' => 8,
653 'size' => CRM_Utils_Type::EIGHT,
654 'where' => 'civicrm_action_schedule.repetition_frequency_unit',
655 'table_name' => 'civicrm_action_schedule',
656 'entity' => 'ActionSchedule',
657 'bao' => 'CRM_Core_BAO_ActionSchedule',
658 'localizable' => 0,
659 'html' => [
660 'type' => 'Select',
661 'label' => ts("Repetition Frequency Unit"),
662 ],
663 'pseudoconstant' => [
664 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
665 ],
666 'add' => '3.4',
667 ],
668 'repetition_frequency_interval' => [
669 'name' => 'repetition_frequency_interval',
670 'type' => CRM_Utils_Type::T_INT,
671 'title' => ts('Repetition Frequency Interval'),
672 'description' => ts('Time interval for repeating the reminder.'),
673 'where' => 'civicrm_action_schedule.repetition_frequency_interval',
674 'default' => '0',
675 'table_name' => 'civicrm_action_schedule',
676 'entity' => 'ActionSchedule',
677 'bao' => 'CRM_Core_BAO_ActionSchedule',
678 'localizable' => 0,
679 'html' => [
680 'label' => ts("Repetition Frequency Interval"),
681 ],
682 'add' => '3.4',
683 ],
684 'end_frequency_unit' => [
685 'name' => 'end_frequency_unit',
686 'type' => CRM_Utils_Type::T_STRING,
687 'title' => ts('End Frequency Unit'),
688 'description' => ts('Time units till repetition of reminder.'),
689 'maxlength' => 8,
690 'size' => CRM_Utils_Type::EIGHT,
691 'where' => 'civicrm_action_schedule.end_frequency_unit',
692 'table_name' => 'civicrm_action_schedule',
693 'entity' => 'ActionSchedule',
694 'bao' => 'CRM_Core_BAO_ActionSchedule',
695 'localizable' => 0,
696 'html' => [
697 'type' => 'Select',
698 'label' => ts("End Frequency Unit"),
699 ],
700 'pseudoconstant' => [
701 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
702 ],
703 'add' => '3.4',
704 ],
705 'end_frequency_interval' => [
706 'name' => 'end_frequency_interval',
707 'type' => CRM_Utils_Type::T_INT,
708 'title' => ts('End Frequency Interval'),
709 'description' => ts('Time interval till repeating the reminder.'),
710 'where' => 'civicrm_action_schedule.end_frequency_interval',
711 'default' => '0',
712 'table_name' => 'civicrm_action_schedule',
713 'entity' => 'ActionSchedule',
714 'bao' => 'CRM_Core_BAO_ActionSchedule',
715 'localizable' => 0,
716 'html' => [
717 'label' => ts("End Frequency Interval"),
718 ],
719 'add' => '3.4',
720 ],
721 'end_action' => [
722 'name' => 'end_action',
723 'type' => CRM_Utils_Type::T_STRING,
724 'title' => ts('End Action'),
725 'description' => ts('Reminder Action till repeating the reminder.'),
726 'maxlength' => 32,
727 'size' => CRM_Utils_Type::MEDIUM,
728 'where' => 'civicrm_action_schedule.end_action',
729 'table_name' => 'civicrm_action_schedule',
730 'entity' => 'ActionSchedule',
731 'bao' => 'CRM_Core_BAO_ActionSchedule',
732 'localizable' => 0,
733 'html' => [
734 'label' => ts("End Action"),
735 ],
736 'add' => '3.4',
737 ],
738 'end_date' => [
739 'name' => 'end_date',
740 'type' => CRM_Utils_Type::T_STRING,
741 'title' => ts('End Date'),
742 'description' => ts('Entity end date'),
743 'maxlength' => 64,
744 'size' => CRM_Utils_Type::BIG,
745 'where' => 'civicrm_action_schedule.end_date',
746 'table_name' => 'civicrm_action_schedule',
747 'entity' => 'ActionSchedule',
748 'bao' => 'CRM_Core_BAO_ActionSchedule',
749 'localizable' => 0,
750 'html' => [
751 'label' => ts("End Date"),
752 ],
753 'add' => '3.4',
754 ],
755 'is_active' => [
756 'name' => 'is_active',
757 'type' => CRM_Utils_Type::T_BOOLEAN,
758 'title' => ts('Schedule is Active?'),
759 'description' => ts('Is this option active?'),
760 'required' => TRUE,
761 'where' => 'civicrm_action_schedule.is_active',
762 'default' => '1',
763 'table_name' => 'civicrm_action_schedule',
764 'entity' => 'ActionSchedule',
765 'bao' => 'CRM_Core_BAO_ActionSchedule',
766 'localizable' => 0,
767 'add' => '3.4',
768 ],
769 'recipient_manual' => [
770 'name' => 'recipient_manual',
771 'type' => CRM_Utils_Type::T_STRING,
772 'title' => ts('Recipient Manual'),
773 'description' => ts('Contact IDs to which reminder should be sent.'),
774 'maxlength' => 128,
775 'size' => CRM_Utils_Type::HUGE,
776 'where' => 'civicrm_action_schedule.recipient_manual',
777 'table_name' => 'civicrm_action_schedule',
778 'entity' => 'ActionSchedule',
779 'bao' => 'CRM_Core_BAO_ActionSchedule',
780 'localizable' => 0,
781 'serialize' => self::SERIALIZE_COMMA,
782 'add' => '3.4',
783 ],
784 'recipient_listing' => [
785 'name' => 'recipient_listing',
786 'type' => CRM_Utils_Type::T_STRING,
787 'title' => ts('Recipient Listing'),
788 'description' => ts('listing based on recipient field.'),
789 'maxlength' => 128,
790 'size' => CRM_Utils_Type::HUGE,
791 'where' => 'civicrm_action_schedule.recipient_listing',
792 'table_name' => 'civicrm_action_schedule',
793 'entity' => 'ActionSchedule',
794 'bao' => 'CRM_Core_BAO_ActionSchedule',
795 'localizable' => 0,
796 'add' => '4.1',
797 ],
798 'body_text' => [
799 'name' => 'body_text',
800 'type' => CRM_Utils_Type::T_LONGTEXT,
801 'title' => ts('Reminder Text'),
802 'description' => ts('Body of the mailing in text format.'),
803 'where' => 'civicrm_action_schedule.body_text',
804 'table_name' => 'civicrm_action_schedule',
805 'entity' => 'ActionSchedule',
806 'bao' => 'CRM_Core_BAO_ActionSchedule',
807 'localizable' => 0,
808 'add' => '3.4',
809 ],
810 'body_html' => [
811 'name' => 'body_html',
812 'type' => CRM_Utils_Type::T_LONGTEXT,
813 'title' => ts('Reminder HTML'),
814 'description' => ts('Body of the mailing in html format.'),
815 'where' => 'civicrm_action_schedule.body_html',
816 'table_name' => 'civicrm_action_schedule',
817 'entity' => 'ActionSchedule',
818 'bao' => 'CRM_Core_BAO_ActionSchedule',
819 'localizable' => 0,
820 'add' => '3.4',
821 ],
822 'sms_body_text' => [
823 'name' => 'sms_body_text',
824 'type' => CRM_Utils_Type::T_LONGTEXT,
825 'title' => ts('SMS Reminder Text'),
826 'description' => ts('Content of the SMS text.'),
827 'where' => 'civicrm_action_schedule.sms_body_text',
828 'table_name' => 'civicrm_action_schedule',
829 'entity' => 'ActionSchedule',
830 'bao' => 'CRM_Core_BAO_ActionSchedule',
831 'localizable' => 0,
832 'add' => '4.5',
833 ],
834 'subject' => [
835 'name' => 'subject',
836 'type' => CRM_Utils_Type::T_STRING,
837 'title' => ts('Reminder Subject'),
838 'description' => ts('Subject of mailing'),
839 'maxlength' => 128,
840 'size' => CRM_Utils_Type::HUGE,
841 'where' => 'civicrm_action_schedule.subject',
842 'table_name' => 'civicrm_action_schedule',
843 'entity' => 'ActionSchedule',
844 'bao' => 'CRM_Core_BAO_ActionSchedule',
845 'localizable' => 0,
846 'add' => '3.4',
847 ],
848 'record_activity' => [
849 'name' => 'record_activity',
850 'type' => CRM_Utils_Type::T_BOOLEAN,
851 'title' => ts('Record Activity for Reminder?'),
852 'description' => ts('Record Activity for this reminder?'),
853 'required' => TRUE,
854 'where' => 'civicrm_action_schedule.record_activity',
855 'default' => '0',
856 'table_name' => 'civicrm_action_schedule',
857 'entity' => 'ActionSchedule',
858 'bao' => 'CRM_Core_BAO_ActionSchedule',
859 'localizable' => 0,
860 'add' => '3.4',
861 ],
862 'mapping_id' => [
863 'name' => 'mapping_id',
864 'type' => CRM_Utils_Type::T_STRING,
865 'title' => ts('Reminder Mapping'),
866 'description' => ts('Name/ID of the mapping to use on this table'),
867 'maxlength' => 64,
868 'size' => CRM_Utils_Type::BIG,
869 'where' => 'civicrm_action_schedule.mapping_id',
870 'table_name' => 'civicrm_action_schedule',
871 'entity' => 'ActionSchedule',
872 'bao' => 'CRM_Core_BAO_ActionSchedule',
873 'localizable' => 0,
874 'add' => '3.4',
875 ],
876 'group_id' => [
877 'name' => 'group_id',
878 'type' => CRM_Utils_Type::T_INT,
879 'title' => ts('Group ID'),
880 'description' => ts('FK to Group'),
881 'where' => 'civicrm_action_schedule.group_id',
882 'table_name' => 'civicrm_action_schedule',
883 'entity' => 'ActionSchedule',
884 'bao' => 'CRM_Core_BAO_ActionSchedule',
885 'localizable' => 0,
886 'FKClassName' => 'CRM_Contact_DAO_Group',
887 'html' => [
888 'type' => 'Select',
889 'label' => ts("Group"),
890 ],
891 'pseudoconstant' => [
892 'table' => 'civicrm_group',
893 'keyColumn' => 'id',
894 'labelColumn' => 'title',
895 ],
896 'add' => '3.4',
897 ],
898 'msg_template_id' => [
899 'name' => 'msg_template_id',
900 'type' => CRM_Utils_Type::T_INT,
901 'title' => ts('Message Template ID'),
902 'description' => ts('FK to the message template.'),
903 'where' => 'civicrm_action_schedule.msg_template_id',
904 'table_name' => 'civicrm_action_schedule',
905 'entity' => 'ActionSchedule',
906 'bao' => 'CRM_Core_BAO_ActionSchedule',
907 'localizable' => 0,
908 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
909 'html' => [
910 'label' => ts("Message Template"),
911 ],
912 'add' => NULL,
913 ],
914 'sms_template_id' => [
915 'name' => 'sms_template_id',
916 'type' => CRM_Utils_Type::T_INT,
917 'title' => ts('SMS Template ID'),
918 'description' => ts('FK to the message template.'),
919 'where' => 'civicrm_action_schedule.sms_template_id',
920 'table_name' => 'civicrm_action_schedule',
921 'entity' => 'ActionSchedule',
922 'bao' => 'CRM_Core_BAO_ActionSchedule',
923 'localizable' => 0,
924 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
925 'html' => [
926 'label' => ts("SMS Template"),
927 ],
928 'add' => NULL,
929 ],
930 'absolute_date' => [
931 'name' => 'absolute_date',
932 'type' => CRM_Utils_Type::T_DATE,
933 'title' => ts('Fixed Date for Reminder'),
934 'description' => ts('Date on which the reminder be sent.'),
935 'where' => 'civicrm_action_schedule.absolute_date',
936 'table_name' => 'civicrm_action_schedule',
937 'entity' => 'ActionSchedule',
938 'bao' => 'CRM_Core_BAO_ActionSchedule',
939 'localizable' => 0,
940 'add' => '4.1',
941 ],
942 'from_name' => [
943 'name' => 'from_name',
944 'type' => CRM_Utils_Type::T_STRING,
945 'title' => ts('Reminder from Name'),
946 'description' => ts('Name in "from" field'),
947 'maxlength' => 255,
948 'size' => CRM_Utils_Type::HUGE,
949 'where' => 'civicrm_action_schedule.from_name',
950 'table_name' => 'civicrm_action_schedule',
951 'entity' => 'ActionSchedule',
952 'bao' => 'CRM_Core_BAO_ActionSchedule',
953 'localizable' => 0,
954 'add' => '4.5',
955 ],
956 'from_email' => [
957 'name' => 'from_email',
958 'type' => CRM_Utils_Type::T_STRING,
959 'title' => ts('Reminder From Email'),
960 'description' => ts('Email address in "from" field'),
961 'maxlength' => 255,
962 'size' => CRM_Utils_Type::HUGE,
963 'where' => 'civicrm_action_schedule.from_email',
964 'table_name' => 'civicrm_action_schedule',
965 'entity' => 'ActionSchedule',
966 'bao' => 'CRM_Core_BAO_ActionSchedule',
967 'localizable' => 0,
968 'add' => '4.5',
969 ],
970 'mode' => [
971 'name' => 'mode',
972 'type' => CRM_Utils_Type::T_STRING,
973 'title' => ts('Message Mode'),
974 'description' => ts('Send the message as email or sms or both.'),
975 'maxlength' => 128,
976 'size' => CRM_Utils_Type::HUGE,
977 'where' => 'civicrm_action_schedule.mode',
978 'default' => 'Email',
979 'table_name' => 'civicrm_action_schedule',
980 'entity' => 'ActionSchedule',
981 'bao' => 'CRM_Core_BAO_ActionSchedule',
982 'localizable' => 0,
983 'html' => [
984 'type' => 'Select',
985 ],
986 'pseudoconstant' => [
987 'optionGroupName' => 'msg_mode',
988 'optionEditPath' => 'civicrm/admin/options/msg_mode',
989 ],
990 'add' => '4.5',
991 ],
992 'sms_provider_id' => [
993 'name' => 'sms_provider_id',
994 'type' => CRM_Utils_Type::T_INT,
995 'title' => ts('SMS Provider ID'),
996 'where' => 'civicrm_action_schedule.sms_provider_id',
997 'table_name' => 'civicrm_action_schedule',
998 'entity' => 'ActionSchedule',
999 'bao' => 'CRM_Core_BAO_ActionSchedule',
1000 'localizable' => 0,
1001 'FKClassName' => 'CRM_SMS_DAO_Provider',
1002 'html' => [
1003 'type' => 'Select',
1004 'label' => ts("SMS Provider"),
1005 ],
1006 'add' => '4.5',
1007 ],
1008 'used_for' => [
1009 'name' => 'used_for',
1010 'type' => CRM_Utils_Type::T_STRING,
1011 'title' => ts('Used For'),
1012 'description' => ts('Used for repeating entity'),
1013 'maxlength' => 64,
1014 'size' => CRM_Utils_Type::BIG,
1015 'where' => 'civicrm_action_schedule.used_for',
1016 'table_name' => 'civicrm_action_schedule',
1017 'entity' => 'ActionSchedule',
1018 'bao' => 'CRM_Core_BAO_ActionSchedule',
1019 'localizable' => 0,
1020 'html' => [
1021 'label' => ts("Used For"),
1022 ],
1023 'add' => '4.6',
1024 ],
1025 'filter_contact_language' => [
1026 'name' => 'filter_contact_language',
1027 'type' => CRM_Utils_Type::T_STRING,
1028 'title' => ts('Filter Contact Language'),
1029 'description' => ts('Used for multilingual installation'),
1030 'maxlength' => 128,
1031 'size' => CRM_Utils_Type::HUGE,
1032 'where' => 'civicrm_action_schedule.filter_contact_language',
1033 'table_name' => 'civicrm_action_schedule',
1034 'entity' => 'ActionSchedule',
1035 'bao' => 'CRM_Core_BAO_ActionSchedule',
1036 'localizable' => 0,
1037 'html' => [
1038 'label' => ts("Filter Contact Language"),
1039 ],
1040 'add' => '4.7',
1041 ],
1042 'communication_language' => [
1043 'name' => 'communication_language',
1044 'type' => CRM_Utils_Type::T_STRING,
1045 'title' => ts('Communication Language'),
1046 'description' => ts('Used for multilingual installation'),
1047 'maxlength' => 8,
1048 'size' => CRM_Utils_Type::EIGHT,
1049 'where' => 'civicrm_action_schedule.communication_language',
1050 'table_name' => 'civicrm_action_schedule',
1051 'entity' => 'ActionSchedule',
1052 'bao' => 'CRM_Core_BAO_ActionSchedule',
1053 'localizable' => 0,
1054 'html' => [
1055 'label' => ts("Communication Language"),
1056 ],
1057 'add' => '4.7',
1058 ],
1059 'action_schedule_created_date' => [
1060 'name' => 'created_date',
1061 'type' => CRM_Utils_Type::T_TIMESTAMP,
1062 'title' => ts('Created Date'),
1063 'description' => ts('When was the scheduled reminder created.'),
1064 'required' => FALSE,
1065 'where' => 'civicrm_action_schedule.created_date',
1066 'export' => TRUE,
1067 'default' => 'CURRENT_TIMESTAMP',
1068 'table_name' => 'civicrm_action_schedule',
1069 'entity' => 'ActionSchedule',
1070 'bao' => 'CRM_Core_BAO_ActionSchedule',
1071 'localizable' => 0,
1072 'add' => '5.34',
1073 ],
1074 'modified_date' => [
1075 'name' => 'modified_date',
1076 'type' => CRM_Utils_Type::T_TIMESTAMP,
1077 'title' => ts('Modified Date'),
1078 'description' => ts('When the reminder was created or modified.'),
1079 'required' => FALSE,
1080 'where' => 'civicrm_action_schedule.modified_date',
1081 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
1082 'table_name' => 'civicrm_action_schedule',
1083 'entity' => 'ActionSchedule',
1084 'bao' => 'CRM_Core_BAO_ActionSchedule',
1085 'localizable' => 0,
1086 'html' => [
1087 'label' => ts("Modified Date"),
1088 ],
1089 'readonly' => TRUE,
1090 'add' => '5.34',
1091 ],
1092 'action_schedule_effective_start_date' => [
1093 'name' => 'effective_start_date',
1094 'type' => CRM_Utils_Type::T_TIMESTAMP,
1095 'title' => ts('Effective start date'),
1096 'description' => ts('Earliest date to consider start events from.'),
1097 'required' => FALSE,
1098 'where' => 'civicrm_action_schedule.effective_start_date',
1099 'export' => TRUE,
1100 'table_name' => 'civicrm_action_schedule',
1101 'entity' => 'ActionSchedule',
1102 'bao' => 'CRM_Core_BAO_ActionSchedule',
1103 'localizable' => 0,
1104 'add' => '5.34',
1105 ],
1106 'action_schedule_effective_end_date' => [
1107 'name' => 'effective_end_date',
1108 'type' => CRM_Utils_Type::T_TIMESTAMP,
1109 'title' => ts('Effective end date'),
1110 'description' => ts('Latest date to consider end events from.'),
1111 'required' => FALSE,
1112 'where' => 'civicrm_action_schedule.effective_end_date',
1113 'export' => TRUE,
1114 'table_name' => 'civicrm_action_schedule',
1115 'entity' => 'ActionSchedule',
1116 'bao' => 'CRM_Core_BAO_ActionSchedule',
1117 'localizable' => 0,
1118 'add' => '5.34',
1119 ],
1120 ];
1121 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
1122 }
1123 return Civi::$statics[__CLASS__]['fields'];
1124 }
1125
1126 /**
1127 * Return a mapping from field-name to the corresponding key (as used in fields()).
1128 *
1129 * @return array
1130 * Array(string $name => string $uniqueName).
1131 */
1132 public static function &fieldKeys() {
1133 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
1134 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
1135 }
1136 return Civi::$statics[__CLASS__]['fieldKeys'];
1137 }
1138
1139 /**
1140 * Returns the names of this table
1141 *
1142 * @return string
1143 */
1144 public static function getTableName() {
1145 return self::$_tableName;
1146 }
1147
1148 /**
1149 * Returns if this table needs to be logged
1150 *
1151 * @return bool
1152 */
1153 public function getLog() {
1154 return self::$_log;
1155 }
1156
1157 /**
1158 * Returns the list of fields that can be imported
1159 *
1160 * @param bool $prefix
1161 *
1162 * @return array
1163 */
1164 public static function &import($prefix = FALSE) {
1165 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_schedule', $prefix, []);
1166 return $r;
1167 }
1168
1169 /**
1170 * Returns the list of fields that can be exported
1171 *
1172 * @param bool $prefix
1173 *
1174 * @return array
1175 */
1176 public static function &export($prefix = FALSE) {
1177 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_schedule', $prefix, []);
1178 return $r;
1179 }
1180
1181 /**
1182 * Returns the list of indices
1183 *
1184 * @param bool $localize
1185 *
1186 * @return array
1187 */
1188 public static function indices($localize = TRUE) {
1189 $indices = [];
1190 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
1191 }
1192
1193 }