[REF] Extract determination of subscription status information
[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:674f2b73fdc72758a31b2f023a33526a)
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 * @param bool $plural
305 * Whether to return the plural version of the title.
306 */
307 public static function getEntityTitle($plural = FALSE) {
308 return $plural ? ts('Action Schedules') : ts('Action Schedule');
309 }
310
311 /**
312 * Returns foreign keys and entity references.
313 *
314 * @return array
315 * [CRM_Core_Reference_Interface]
316 */
317 public static function getReferenceColumns() {
318 if (!isset(Civi::$statics[__CLASS__]['links'])) {
319 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
320 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'group_id', 'civicrm_group', 'id');
321 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id');
322 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'sms_template_id', 'civicrm_msg_template', 'id');
323 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id');
324 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
325 }
326 return Civi::$statics[__CLASS__]['links'];
327 }
328
329 /**
330 * Returns all the column names of this table
331 *
332 * @return array
333 */
334 public static function &fields() {
335 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
336 Civi::$statics[__CLASS__]['fields'] = [
337 'id' => [
338 'name' => 'id',
339 'type' => CRM_Utils_Type::T_INT,
340 'title' => ts('Action Schedule ID'),
341 'required' => TRUE,
342 'where' => 'civicrm_action_schedule.id',
343 'table_name' => 'civicrm_action_schedule',
344 'entity' => 'ActionSchedule',
345 'bao' => 'CRM_Core_BAO_ActionSchedule',
346 'localizable' => 0,
347 'add' => '3.4',
348 ],
349 'name' => [
350 'name' => 'name',
351 'type' => CRM_Utils_Type::T_STRING,
352 'title' => ts('Name'),
353 'description' => ts('Name of the action(reminder)'),
354 'maxlength' => 64,
355 'size' => CRM_Utils_Type::BIG,
356 'where' => 'civicrm_action_schedule.name',
357 'table_name' => 'civicrm_action_schedule',
358 'entity' => 'ActionSchedule',
359 'bao' => 'CRM_Core_BAO_ActionSchedule',
360 'localizable' => 0,
361 'add' => '3.4',
362 ],
363 'title' => [
364 'name' => 'title',
365 'type' => CRM_Utils_Type::T_STRING,
366 'title' => ts('Title'),
367 'description' => ts('Title of the action(reminder)'),
368 'maxlength' => 64,
369 'size' => CRM_Utils_Type::BIG,
370 'where' => 'civicrm_action_schedule.title',
371 'table_name' => 'civicrm_action_schedule',
372 'entity' => 'ActionSchedule',
373 'bao' => 'CRM_Core_BAO_ActionSchedule',
374 'localizable' => 0,
375 'add' => '3.4',
376 ],
377 'recipient' => [
378 'name' => 'recipient',
379 'type' => CRM_Utils_Type::T_STRING,
380 'title' => ts('Recipient'),
381 'description' => ts('Recipient'),
382 'maxlength' => 64,
383 'size' => CRM_Utils_Type::BIG,
384 'where' => 'civicrm_action_schedule.recipient',
385 'table_name' => 'civicrm_action_schedule',
386 'entity' => 'ActionSchedule',
387 'bao' => 'CRM_Core_BAO_ActionSchedule',
388 'localizable' => 0,
389 'add' => '3.4',
390 ],
391 'limit_to' => [
392 'name' => 'limit_to',
393 'type' => CRM_Utils_Type::T_BOOLEAN,
394 'title' => ts('Limit To'),
395 'description' => ts('Is this the recipient criteria limited to OR in addition to?'),
396 'where' => 'civicrm_action_schedule.limit_to',
397 'table_name' => 'civicrm_action_schedule',
398 'entity' => 'ActionSchedule',
399 'bao' => 'CRM_Core_BAO_ActionSchedule',
400 'localizable' => 0,
401 'add' => '4.4',
402 ],
403 'entity_value' => [
404 'name' => 'entity_value',
405 'type' => CRM_Utils_Type::T_STRING,
406 'title' => ts('Entity Value'),
407 'description' => ts('Entity value'),
408 'maxlength' => 255,
409 'size' => CRM_Utils_Type::HUGE,
410 'where' => 'civicrm_action_schedule.entity_value',
411 'table_name' => 'civicrm_action_schedule',
412 'entity' => 'ActionSchedule',
413 'bao' => 'CRM_Core_BAO_ActionSchedule',
414 'localizable' => 0,
415 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
416 'add' => '3.4',
417 ],
418 'entity_status' => [
419 'name' => 'entity_status',
420 'type' => CRM_Utils_Type::T_STRING,
421 'title' => ts('Entity Status'),
422 'description' => ts('Entity status'),
423 'maxlength' => 64,
424 'size' => CRM_Utils_Type::BIG,
425 'where' => 'civicrm_action_schedule.entity_status',
426 'table_name' => 'civicrm_action_schedule',
427 'entity' => 'ActionSchedule',
428 'bao' => 'CRM_Core_BAO_ActionSchedule',
429 'localizable' => 0,
430 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
431 'add' => '3.4',
432 ],
433 'start_action_offset' => [
434 'name' => 'start_action_offset',
435 'type' => CRM_Utils_Type::T_INT,
436 'title' => ts('Start Action Offset'),
437 'description' => ts('Reminder Interval.'),
438 'where' => 'civicrm_action_schedule.start_action_offset',
439 'default' => '0',
440 'table_name' => 'civicrm_action_schedule',
441 'entity' => 'ActionSchedule',
442 'bao' => 'CRM_Core_BAO_ActionSchedule',
443 'localizable' => 0,
444 'add' => '3.4',
445 ],
446 'start_action_unit' => [
447 'name' => 'start_action_unit',
448 'type' => CRM_Utils_Type::T_STRING,
449 'title' => ts('Start Action Unit'),
450 'description' => ts('Time units for reminder.'),
451 'maxlength' => 8,
452 'size' => CRM_Utils_Type::EIGHT,
453 'where' => 'civicrm_action_schedule.start_action_unit',
454 'table_name' => 'civicrm_action_schedule',
455 'entity' => 'ActionSchedule',
456 'bao' => 'CRM_Core_BAO_ActionSchedule',
457 'localizable' => 0,
458 'html' => [
459 'type' => 'Select',
460 ],
461 'pseudoconstant' => [
462 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
463 ],
464 'add' => '3.4',
465 ],
466 'start_action_condition' => [
467 'name' => 'start_action_condition',
468 'type' => CRM_Utils_Type::T_STRING,
469 'title' => ts('Start Action Condition'),
470 'description' => ts('Reminder Action'),
471 'maxlength' => 64,
472 'size' => CRM_Utils_Type::BIG,
473 'where' => 'civicrm_action_schedule.start_action_condition',
474 'table_name' => 'civicrm_action_schedule',
475 'entity' => 'ActionSchedule',
476 'bao' => 'CRM_Core_BAO_ActionSchedule',
477 'localizable' => 0,
478 'add' => '3.4',
479 ],
480 'start_action_date' => [
481 'name' => 'start_action_date',
482 'type' => CRM_Utils_Type::T_STRING,
483 'title' => ts('Start Action Date'),
484 'description' => ts('Entity date'),
485 'maxlength' => 64,
486 'size' => CRM_Utils_Type::BIG,
487 'where' => 'civicrm_action_schedule.start_action_date',
488 'table_name' => 'civicrm_action_schedule',
489 'entity' => 'ActionSchedule',
490 'bao' => 'CRM_Core_BAO_ActionSchedule',
491 'localizable' => 0,
492 'add' => '3.4',
493 ],
494 'is_repeat' => [
495 'name' => 'is_repeat',
496 'type' => CRM_Utils_Type::T_BOOLEAN,
497 'title' => ts('Repeat?'),
498 'where' => 'civicrm_action_schedule.is_repeat',
499 'default' => '0',
500 'table_name' => 'civicrm_action_schedule',
501 'entity' => 'ActionSchedule',
502 'bao' => 'CRM_Core_BAO_ActionSchedule',
503 'localizable' => 0,
504 'add' => '3.4',
505 ],
506 'repetition_frequency_unit' => [
507 'name' => 'repetition_frequency_unit',
508 'type' => CRM_Utils_Type::T_STRING,
509 'title' => ts('Repetition Frequency Unit'),
510 'description' => ts('Time units for repetition of reminder.'),
511 'maxlength' => 8,
512 'size' => CRM_Utils_Type::EIGHT,
513 'where' => 'civicrm_action_schedule.repetition_frequency_unit',
514 'table_name' => 'civicrm_action_schedule',
515 'entity' => 'ActionSchedule',
516 'bao' => 'CRM_Core_BAO_ActionSchedule',
517 'localizable' => 0,
518 'html' => [
519 'type' => 'Select',
520 ],
521 'pseudoconstant' => [
522 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
523 ],
524 'add' => '3.4',
525 ],
526 'repetition_frequency_interval' => [
527 'name' => 'repetition_frequency_interval',
528 'type' => CRM_Utils_Type::T_INT,
529 'title' => ts('Repetition Frequency Interval'),
530 'description' => ts('Time interval for repeating the reminder.'),
531 'where' => 'civicrm_action_schedule.repetition_frequency_interval',
532 'default' => '0',
533 'table_name' => 'civicrm_action_schedule',
534 'entity' => 'ActionSchedule',
535 'bao' => 'CRM_Core_BAO_ActionSchedule',
536 'localizable' => 0,
537 'add' => '3.4',
538 ],
539 'end_frequency_unit' => [
540 'name' => 'end_frequency_unit',
541 'type' => CRM_Utils_Type::T_STRING,
542 'title' => ts('End Frequency Unit'),
543 'description' => ts('Time units till repetition of reminder.'),
544 'maxlength' => 8,
545 'size' => CRM_Utils_Type::EIGHT,
546 'where' => 'civicrm_action_schedule.end_frequency_unit',
547 'table_name' => 'civicrm_action_schedule',
548 'entity' => 'ActionSchedule',
549 'bao' => 'CRM_Core_BAO_ActionSchedule',
550 'localizable' => 0,
551 'html' => [
552 'type' => 'Select',
553 ],
554 'pseudoconstant' => [
555 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
556 ],
557 'add' => '3.4',
558 ],
559 'end_frequency_interval' => [
560 'name' => 'end_frequency_interval',
561 'type' => CRM_Utils_Type::T_INT,
562 'title' => ts('End Frequency Interval'),
563 'description' => ts('Time interval till repeating the reminder.'),
564 'where' => 'civicrm_action_schedule.end_frequency_interval',
565 'default' => '0',
566 'table_name' => 'civicrm_action_schedule',
567 'entity' => 'ActionSchedule',
568 'bao' => 'CRM_Core_BAO_ActionSchedule',
569 'localizable' => 0,
570 'add' => '3.4',
571 ],
572 'end_action' => [
573 'name' => 'end_action',
574 'type' => CRM_Utils_Type::T_STRING,
575 'title' => ts('End Action'),
576 'description' => ts('Reminder Action till repeating the reminder.'),
577 'maxlength' => 32,
578 'size' => CRM_Utils_Type::MEDIUM,
579 'where' => 'civicrm_action_schedule.end_action',
580 'table_name' => 'civicrm_action_schedule',
581 'entity' => 'ActionSchedule',
582 'bao' => 'CRM_Core_BAO_ActionSchedule',
583 'localizable' => 0,
584 'add' => '3.4',
585 ],
586 'end_date' => [
587 'name' => 'end_date',
588 'type' => CRM_Utils_Type::T_STRING,
589 'title' => ts('End Date'),
590 'description' => ts('Entity end date'),
591 'maxlength' => 64,
592 'size' => CRM_Utils_Type::BIG,
593 'where' => 'civicrm_action_schedule.end_date',
594 'table_name' => 'civicrm_action_schedule',
595 'entity' => 'ActionSchedule',
596 'bao' => 'CRM_Core_BAO_ActionSchedule',
597 'localizable' => 0,
598 'add' => '3.4',
599 ],
600 'is_active' => [
601 'name' => 'is_active',
602 'type' => CRM_Utils_Type::T_BOOLEAN,
603 'title' => ts('Schedule is Active?'),
604 'description' => ts('Is this option active?'),
605 'where' => 'civicrm_action_schedule.is_active',
606 'default' => '1',
607 'table_name' => 'civicrm_action_schedule',
608 'entity' => 'ActionSchedule',
609 'bao' => 'CRM_Core_BAO_ActionSchedule',
610 'localizable' => 0,
611 'add' => '3.4',
612 ],
613 'recipient_manual' => [
614 'name' => 'recipient_manual',
615 'type' => CRM_Utils_Type::T_STRING,
616 'title' => ts('Recipient Manual'),
617 'description' => ts('Contact IDs to which reminder should be sent.'),
618 'maxlength' => 128,
619 'size' => CRM_Utils_Type::HUGE,
620 'where' => 'civicrm_action_schedule.recipient_manual',
621 'table_name' => 'civicrm_action_schedule',
622 'entity' => 'ActionSchedule',
623 'bao' => 'CRM_Core_BAO_ActionSchedule',
624 'localizable' => 0,
625 'serialize' => self::SERIALIZE_COMMA,
626 'add' => '3.4',
627 ],
628 'recipient_listing' => [
629 'name' => 'recipient_listing',
630 'type' => CRM_Utils_Type::T_STRING,
631 'title' => ts('Recipient Listing'),
632 'description' => ts('listing based on recipient field.'),
633 'maxlength' => 128,
634 'size' => CRM_Utils_Type::HUGE,
635 'where' => 'civicrm_action_schedule.recipient_listing',
636 'table_name' => 'civicrm_action_schedule',
637 'entity' => 'ActionSchedule',
638 'bao' => 'CRM_Core_BAO_ActionSchedule',
639 'localizable' => 0,
640 'add' => '4.1',
641 ],
642 'body_text' => [
643 'name' => 'body_text',
644 'type' => CRM_Utils_Type::T_LONGTEXT,
645 'title' => ts('Reminder Text'),
646 'description' => ts('Body of the mailing in text format.'),
647 'where' => 'civicrm_action_schedule.body_text',
648 'table_name' => 'civicrm_action_schedule',
649 'entity' => 'ActionSchedule',
650 'bao' => 'CRM_Core_BAO_ActionSchedule',
651 'localizable' => 0,
652 'add' => '3.4',
653 ],
654 'body_html' => [
655 'name' => 'body_html',
656 'type' => CRM_Utils_Type::T_LONGTEXT,
657 'title' => ts('Reminder HTML'),
658 'description' => ts('Body of the mailing in html format.'),
659 'where' => 'civicrm_action_schedule.body_html',
660 'table_name' => 'civicrm_action_schedule',
661 'entity' => 'ActionSchedule',
662 'bao' => 'CRM_Core_BAO_ActionSchedule',
663 'localizable' => 0,
664 'add' => '3.4',
665 ],
666 'sms_body_text' => [
667 'name' => 'sms_body_text',
668 'type' => CRM_Utils_Type::T_LONGTEXT,
669 'title' => ts('SMS Reminder Text'),
670 'description' => ts('Content of the SMS text.'),
671 'where' => 'civicrm_action_schedule.sms_body_text',
672 'table_name' => 'civicrm_action_schedule',
673 'entity' => 'ActionSchedule',
674 'bao' => 'CRM_Core_BAO_ActionSchedule',
675 'localizable' => 0,
676 'add' => '4.5',
677 ],
678 'subject' => [
679 'name' => 'subject',
680 'type' => CRM_Utils_Type::T_STRING,
681 'title' => ts('Reminder Subject'),
682 'description' => ts('Subject of mailing'),
683 'maxlength' => 128,
684 'size' => CRM_Utils_Type::HUGE,
685 'where' => 'civicrm_action_schedule.subject',
686 'table_name' => 'civicrm_action_schedule',
687 'entity' => 'ActionSchedule',
688 'bao' => 'CRM_Core_BAO_ActionSchedule',
689 'localizable' => 0,
690 'add' => '3.4',
691 ],
692 'record_activity' => [
693 'name' => 'record_activity',
694 'type' => CRM_Utils_Type::T_BOOLEAN,
695 'title' => ts('Record Activity for Reminder?'),
696 'description' => ts('Record Activity for this reminder?'),
697 'where' => 'civicrm_action_schedule.record_activity',
698 'default' => 'NULL',
699 'table_name' => 'civicrm_action_schedule',
700 'entity' => 'ActionSchedule',
701 'bao' => 'CRM_Core_BAO_ActionSchedule',
702 'localizable' => 0,
703 'add' => '3.4',
704 ],
705 'mapping_id' => [
706 'name' => 'mapping_id',
707 'type' => CRM_Utils_Type::T_STRING,
708 'title' => ts('Reminder Mapping'),
709 'description' => ts('Name/ID of the mapping to use on this table'),
710 'maxlength' => 64,
711 'size' => CRM_Utils_Type::BIG,
712 'where' => 'civicrm_action_schedule.mapping_id',
713 'table_name' => 'civicrm_action_schedule',
714 'entity' => 'ActionSchedule',
715 'bao' => 'CRM_Core_BAO_ActionSchedule',
716 'localizable' => 0,
717 'add' => '3.4',
718 ],
719 'group_id' => [
720 'name' => 'group_id',
721 'type' => CRM_Utils_Type::T_INT,
722 'title' => ts('Reminder Group'),
723 'description' => ts('FK to Group'),
724 'where' => 'civicrm_action_schedule.group_id',
725 'table_name' => 'civicrm_action_schedule',
726 'entity' => 'ActionSchedule',
727 'bao' => 'CRM_Core_BAO_ActionSchedule',
728 'localizable' => 0,
729 'FKClassName' => 'CRM_Contact_DAO_Group',
730 'html' => [
731 'type' => 'Select',
732 ],
733 'pseudoconstant' => [
734 'table' => 'civicrm_group',
735 'keyColumn' => 'id',
736 'labelColumn' => 'title',
737 ],
738 'add' => '3.4',
739 ],
740 'msg_template_id' => [
741 'name' => 'msg_template_id',
742 'type' => CRM_Utils_Type::T_INT,
743 'title' => ts('Reminder Template'),
744 'description' => ts('FK to the message template.'),
745 'where' => 'civicrm_action_schedule.msg_template_id',
746 'table_name' => 'civicrm_action_schedule',
747 'entity' => 'ActionSchedule',
748 'bao' => 'CRM_Core_BAO_ActionSchedule',
749 'localizable' => 0,
750 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
751 'add' => NULL,
752 ],
753 'sms_template_id' => [
754 'name' => 'sms_template_id',
755 'type' => CRM_Utils_Type::T_INT,
756 'title' => ts('SMS Reminder Template'),
757 'description' => ts('FK to the message template.'),
758 'where' => 'civicrm_action_schedule.sms_template_id',
759 'table_name' => 'civicrm_action_schedule',
760 'entity' => 'ActionSchedule',
761 'bao' => 'CRM_Core_BAO_ActionSchedule',
762 'localizable' => 0,
763 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
764 'add' => NULL,
765 ],
766 'absolute_date' => [
767 'name' => 'absolute_date',
768 'type' => CRM_Utils_Type::T_DATE,
769 'title' => ts('Fixed Date for Reminder'),
770 'description' => ts('Date on which the reminder be sent.'),
771 'where' => 'civicrm_action_schedule.absolute_date',
772 'table_name' => 'civicrm_action_schedule',
773 'entity' => 'ActionSchedule',
774 'bao' => 'CRM_Core_BAO_ActionSchedule',
775 'localizable' => 0,
776 'add' => '4.1',
777 ],
778 'from_name' => [
779 'name' => 'from_name',
780 'type' => CRM_Utils_Type::T_STRING,
781 'title' => ts('Reminder from Name'),
782 'description' => ts('Name in "from" field'),
783 'maxlength' => 255,
784 'size' => CRM_Utils_Type::HUGE,
785 'where' => 'civicrm_action_schedule.from_name',
786 'table_name' => 'civicrm_action_schedule',
787 'entity' => 'ActionSchedule',
788 'bao' => 'CRM_Core_BAO_ActionSchedule',
789 'localizable' => 0,
790 'add' => '4.5',
791 ],
792 'from_email' => [
793 'name' => 'from_email',
794 'type' => CRM_Utils_Type::T_STRING,
795 'title' => ts('Reminder From Email'),
796 'description' => ts('Email address in "from" field'),
797 'maxlength' => 255,
798 'size' => CRM_Utils_Type::HUGE,
799 'where' => 'civicrm_action_schedule.from_email',
800 'table_name' => 'civicrm_action_schedule',
801 'entity' => 'ActionSchedule',
802 'bao' => 'CRM_Core_BAO_ActionSchedule',
803 'localizable' => 0,
804 'add' => '4.5',
805 ],
806 'mode' => [
807 'name' => 'mode',
808 'type' => CRM_Utils_Type::T_STRING,
809 'title' => ts('Message Mode'),
810 'description' => ts('Send the message as email or sms or both.'),
811 'maxlength' => 128,
812 'size' => CRM_Utils_Type::HUGE,
813 'where' => 'civicrm_action_schedule.mode',
814 'default' => 'Email',
815 'table_name' => 'civicrm_action_schedule',
816 'entity' => 'ActionSchedule',
817 'bao' => 'CRM_Core_BAO_ActionSchedule',
818 'localizable' => 0,
819 'html' => [
820 'type' => 'Select',
821 ],
822 'pseudoconstant' => [
823 'optionGroupName' => 'msg_mode',
824 'optionEditPath' => 'civicrm/admin/options/msg_mode',
825 ],
826 'add' => '4.5',
827 ],
828 'sms_provider_id' => [
829 'name' => 'sms_provider_id',
830 'type' => CRM_Utils_Type::T_INT,
831 'title' => ts('SMS Provider'),
832 'where' => 'civicrm_action_schedule.sms_provider_id',
833 'table_name' => 'civicrm_action_schedule',
834 'entity' => 'ActionSchedule',
835 'bao' => 'CRM_Core_BAO_ActionSchedule',
836 'localizable' => 0,
837 'FKClassName' => 'CRM_SMS_DAO_Provider',
838 'html' => [
839 'type' => 'Select',
840 ],
841 'add' => '4.5',
842 ],
843 'used_for' => [
844 'name' => 'used_for',
845 'type' => CRM_Utils_Type::T_STRING,
846 'title' => ts('Used For'),
847 'description' => ts('Used for repeating entity'),
848 'maxlength' => 64,
849 'size' => CRM_Utils_Type::BIG,
850 'where' => 'civicrm_action_schedule.used_for',
851 'table_name' => 'civicrm_action_schedule',
852 'entity' => 'ActionSchedule',
853 'bao' => 'CRM_Core_BAO_ActionSchedule',
854 'localizable' => 0,
855 'add' => '4.6',
856 ],
857 'filter_contact_language' => [
858 'name' => 'filter_contact_language',
859 'type' => CRM_Utils_Type::T_STRING,
860 'title' => ts('Filter Contact Language'),
861 'description' => ts('Used for multilingual installation'),
862 'maxlength' => 128,
863 'size' => CRM_Utils_Type::HUGE,
864 'where' => 'civicrm_action_schedule.filter_contact_language',
865 'table_name' => 'civicrm_action_schedule',
866 'entity' => 'ActionSchedule',
867 'bao' => 'CRM_Core_BAO_ActionSchedule',
868 'localizable' => 0,
869 'add' => '4.7',
870 ],
871 'communication_language' => [
872 'name' => 'communication_language',
873 'type' => CRM_Utils_Type::T_STRING,
874 'title' => ts('Communication Language'),
875 'description' => ts('Used for multilingual installation'),
876 'maxlength' => 8,
877 'size' => CRM_Utils_Type::EIGHT,
878 'where' => 'civicrm_action_schedule.communication_language',
879 'table_name' => 'civicrm_action_schedule',
880 'entity' => 'ActionSchedule',
881 'bao' => 'CRM_Core_BAO_ActionSchedule',
882 'localizable' => 0,
883 'add' => '4.7',
884 ],
885 ];
886 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
887 }
888 return Civi::$statics[__CLASS__]['fields'];
889 }
890
891 /**
892 * Return a mapping from field-name to the corresponding key (as used in fields()).
893 *
894 * @return array
895 * Array(string $name => string $uniqueName).
896 */
897 public static function &fieldKeys() {
898 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
899 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
900 }
901 return Civi::$statics[__CLASS__]['fieldKeys'];
902 }
903
904 /**
905 * Returns the names of this table
906 *
907 * @return string
908 */
909 public static function getTableName() {
910 return self::$_tableName;
911 }
912
913 /**
914 * Returns if this table needs to be logged
915 *
916 * @return bool
917 */
918 public function getLog() {
919 return self::$_log;
920 }
921
922 /**
923 * Returns the list of fields that can be imported
924 *
925 * @param bool $prefix
926 *
927 * @return array
928 */
929 public static function &import($prefix = FALSE) {
930 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_schedule', $prefix, []);
931 return $r;
932 }
933
934 /**
935 * Returns the list of fields that can be exported
936 *
937 * @param bool $prefix
938 *
939 * @return array
940 */
941 public static function &export($prefix = FALSE) {
942 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_schedule', $prefix, []);
943 return $r;
944 }
945
946 /**
947 * Returns the list of indices
948 *
949 * @param bool $localize
950 *
951 * @return array
952 */
953 public static function indices($localize = TRUE) {
954 $indices = [];
955 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
956 }
957
958 }