5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/ActionSchedule.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4493f5d18b2b452d4a6b9ee4e15a15bf)
13 * Database access object for the ActionSchedule entity.
15 class CRM_Core_DAO_ActionSchedule
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_action_schedule';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
37 * Name of the action(reminder)
44 * Title of the action(reminder)
58 * Is this the recipient criteria limited to OR in addition to?
76 public $entity_status;
83 public $start_action_offset;
86 * Time units for reminder.
90 public $start_action_unit;
97 public $start_action_condition;
104 public $start_action_date;
112 * Time units for repetition of reminder.
116 public $repetition_frequency_unit;
119 * Time interval for repeating the reminder.
123 public $repetition_frequency_interval;
126 * Time units till repetition of reminder.
130 public $end_frequency_unit;
133 * Time interval till repeating the reminder.
137 public $end_frequency_interval;
140 * Reminder Action till repeating the reminder.
154 * Is this option active?
161 * Contact IDs to which reminder should be sent.
165 public $recipient_manual;
168 * listing based on recipient field.
172 public $recipient_listing;
175 * Body of the mailing in text format.
182 * Body of the mailing in html format.
189 * Content of the SMS text.
193 public $sms_body_text;
203 * Record Activity for this reminder?
207 public $record_activity;
210 * Name/ID of the mapping to use on this table
224 * FK to the message template.
228 public $msg_template_id;
231 * FK to the message template.
235 public $sms_template_id;
238 * Date on which the reminder be sent.
242 public $absolute_date;
245 * Name in "from" field
252 * Email address in "from" field
259 * Send the message as email or sms or both.
268 public $sms_provider_id;
271 * Used for repeating entity
278 * Used for multilingual installation
282 public $filter_contact_language;
285 * Used for multilingual installation
289 public $communication_language;
294 public function __construct() {
295 $this->__table
= 'civicrm_action_schedule';
296 parent
::__construct();
300 * Returns localized title of this entity.
302 public static function getEntityTitle() {
303 return ts('Action Schedules');
307 * Returns foreign keys and entity references.
310 * [CRM_Core_Reference_Interface]
312 public static function getReferenceColumns() {
313 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
314 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
315 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'group_id', 'civicrm_group', 'id');
316 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id');
317 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'sms_template_id', 'civicrm_msg_template', 'id');
318 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id');
319 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
321 return Civi
::$statics[__CLASS__
]['links'];
325 * Returns all the column names of this table
329 public static function &fields() {
330 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
331 Civi
::$statics[__CLASS__
]['fields'] = [
334 'type' => CRM_Utils_Type
::T_INT
,
335 'title' => ts('Action Schedule ID'),
337 'where' => 'civicrm_action_schedule.id',
338 'table_name' => 'civicrm_action_schedule',
339 'entity' => 'ActionSchedule',
340 'bao' => 'CRM_Core_BAO_ActionSchedule',
346 'type' => CRM_Utils_Type
::T_STRING
,
347 'title' => ts('Name'),
348 'description' => ts('Name of the action(reminder)'),
350 'size' => CRM_Utils_Type
::BIG
,
351 'where' => 'civicrm_action_schedule.name',
352 'table_name' => 'civicrm_action_schedule',
353 'entity' => 'ActionSchedule',
354 'bao' => 'CRM_Core_BAO_ActionSchedule',
360 'type' => CRM_Utils_Type
::T_STRING
,
361 'title' => ts('Title'),
362 'description' => ts('Title of the action(reminder)'),
364 'size' => CRM_Utils_Type
::BIG
,
365 'where' => 'civicrm_action_schedule.title',
366 'table_name' => 'civicrm_action_schedule',
367 'entity' => 'ActionSchedule',
368 'bao' => 'CRM_Core_BAO_ActionSchedule',
373 'name' => 'recipient',
374 'type' => CRM_Utils_Type
::T_STRING
,
375 'title' => ts('Recipient'),
376 'description' => ts('Recipient'),
378 'size' => CRM_Utils_Type
::BIG
,
379 'where' => 'civicrm_action_schedule.recipient',
380 'table_name' => 'civicrm_action_schedule',
381 'entity' => 'ActionSchedule',
382 'bao' => 'CRM_Core_BAO_ActionSchedule',
387 'name' => 'limit_to',
388 'type' => CRM_Utils_Type
::T_BOOLEAN
,
389 'title' => ts('Limit To'),
390 'description' => ts('Is this the recipient criteria limited to OR in addition to?'),
391 'where' => 'civicrm_action_schedule.limit_to',
392 'table_name' => 'civicrm_action_schedule',
393 'entity' => 'ActionSchedule',
394 'bao' => 'CRM_Core_BAO_ActionSchedule',
399 'name' => 'entity_value',
400 'type' => CRM_Utils_Type
::T_STRING
,
401 'title' => ts('Entity Value'),
402 'description' => ts('Entity value'),
404 'size' => CRM_Utils_Type
::HUGE
,
405 'where' => 'civicrm_action_schedule.entity_value',
406 'table_name' => 'civicrm_action_schedule',
407 'entity' => 'ActionSchedule',
408 'bao' => 'CRM_Core_BAO_ActionSchedule',
413 'name' => 'entity_status',
414 'type' => CRM_Utils_Type
::T_STRING
,
415 'title' => ts('Entity Status'),
416 'description' => ts('Entity status'),
418 'size' => CRM_Utils_Type
::BIG
,
419 'where' => 'civicrm_action_schedule.entity_status',
420 'table_name' => 'civicrm_action_schedule',
421 'entity' => 'ActionSchedule',
422 'bao' => 'CRM_Core_BAO_ActionSchedule',
426 'start_action_offset' => [
427 'name' => 'start_action_offset',
428 'type' => CRM_Utils_Type
::T_INT
,
429 'title' => ts('Start Action Offset'),
430 'description' => ts('Reminder Interval.'),
431 'where' => 'civicrm_action_schedule.start_action_offset',
433 'table_name' => 'civicrm_action_schedule',
434 'entity' => 'ActionSchedule',
435 'bao' => 'CRM_Core_BAO_ActionSchedule',
439 'start_action_unit' => [
440 'name' => 'start_action_unit',
441 'type' => CRM_Utils_Type
::T_STRING
,
442 'title' => ts('Start Action Unit'),
443 'description' => ts('Time units for reminder.'),
445 'size' => CRM_Utils_Type
::EIGHT
,
446 'where' => 'civicrm_action_schedule.start_action_unit',
447 'table_name' => 'civicrm_action_schedule',
448 'entity' => 'ActionSchedule',
449 'bao' => 'CRM_Core_BAO_ActionSchedule',
454 'pseudoconstant' => [
455 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
459 'start_action_condition' => [
460 'name' => 'start_action_condition',
461 'type' => CRM_Utils_Type
::T_STRING
,
462 'title' => ts('Start Action Condition'),
463 'description' => ts('Reminder Action'),
465 'size' => CRM_Utils_Type
::BIG
,
466 'where' => 'civicrm_action_schedule.start_action_condition',
467 'table_name' => 'civicrm_action_schedule',
468 'entity' => 'ActionSchedule',
469 'bao' => 'CRM_Core_BAO_ActionSchedule',
473 'start_action_date' => [
474 'name' => 'start_action_date',
475 'type' => CRM_Utils_Type
::T_STRING
,
476 'title' => ts('Start Action Date'),
477 'description' => ts('Entity date'),
479 'size' => CRM_Utils_Type
::BIG
,
480 'where' => 'civicrm_action_schedule.start_action_date',
481 'table_name' => 'civicrm_action_schedule',
482 'entity' => 'ActionSchedule',
483 'bao' => 'CRM_Core_BAO_ActionSchedule',
488 'name' => 'is_repeat',
489 'type' => CRM_Utils_Type
::T_BOOLEAN
,
490 'title' => ts('Repeat?'),
491 'where' => 'civicrm_action_schedule.is_repeat',
493 'table_name' => 'civicrm_action_schedule',
494 'entity' => 'ActionSchedule',
495 'bao' => 'CRM_Core_BAO_ActionSchedule',
499 'repetition_frequency_unit' => [
500 'name' => 'repetition_frequency_unit',
501 'type' => CRM_Utils_Type
::T_STRING
,
502 'title' => ts('Repetition Frequency Unit'),
503 'description' => ts('Time units for repetition of reminder.'),
505 'size' => CRM_Utils_Type
::EIGHT
,
506 'where' => 'civicrm_action_schedule.repetition_frequency_unit',
507 'table_name' => 'civicrm_action_schedule',
508 'entity' => 'ActionSchedule',
509 'bao' => 'CRM_Core_BAO_ActionSchedule',
514 'pseudoconstant' => [
515 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
519 'repetition_frequency_interval' => [
520 'name' => 'repetition_frequency_interval',
521 'type' => CRM_Utils_Type
::T_INT
,
522 'title' => ts('Repetition Frequency Interval'),
523 'description' => ts('Time interval for repeating the reminder.'),
524 'where' => 'civicrm_action_schedule.repetition_frequency_interval',
526 'table_name' => 'civicrm_action_schedule',
527 'entity' => 'ActionSchedule',
528 'bao' => 'CRM_Core_BAO_ActionSchedule',
532 'end_frequency_unit' => [
533 'name' => 'end_frequency_unit',
534 'type' => CRM_Utils_Type
::T_STRING
,
535 'title' => ts('End Frequency Unit'),
536 'description' => ts('Time units till repetition of reminder.'),
538 'size' => CRM_Utils_Type
::EIGHT
,
539 'where' => 'civicrm_action_schedule.end_frequency_unit',
540 'table_name' => 'civicrm_action_schedule',
541 'entity' => 'ActionSchedule',
542 'bao' => 'CRM_Core_BAO_ActionSchedule',
547 'pseudoconstant' => [
548 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
552 'end_frequency_interval' => [
553 'name' => 'end_frequency_interval',
554 'type' => CRM_Utils_Type
::T_INT
,
555 'title' => ts('End Frequency Interval'),
556 'description' => ts('Time interval till repeating the reminder.'),
557 'where' => 'civicrm_action_schedule.end_frequency_interval',
559 'table_name' => 'civicrm_action_schedule',
560 'entity' => 'ActionSchedule',
561 'bao' => 'CRM_Core_BAO_ActionSchedule',
566 'name' => 'end_action',
567 'type' => CRM_Utils_Type
::T_STRING
,
568 'title' => ts('End Action'),
569 'description' => ts('Reminder Action till repeating the reminder.'),
571 'size' => CRM_Utils_Type
::MEDIUM
,
572 'where' => 'civicrm_action_schedule.end_action',
573 'table_name' => 'civicrm_action_schedule',
574 'entity' => 'ActionSchedule',
575 'bao' => 'CRM_Core_BAO_ActionSchedule',
580 'name' => 'end_date',
581 'type' => CRM_Utils_Type
::T_STRING
,
582 'title' => ts('End Date'),
583 'description' => ts('Entity end date'),
585 'size' => CRM_Utils_Type
::BIG
,
586 'where' => 'civicrm_action_schedule.end_date',
587 'table_name' => 'civicrm_action_schedule',
588 'entity' => 'ActionSchedule',
589 'bao' => 'CRM_Core_BAO_ActionSchedule',
594 'name' => 'is_active',
595 'type' => CRM_Utils_Type
::T_BOOLEAN
,
596 'title' => ts('Schedule is Active?'),
597 'description' => ts('Is this option active?'),
598 'where' => 'civicrm_action_schedule.is_active',
600 'table_name' => 'civicrm_action_schedule',
601 'entity' => 'ActionSchedule',
602 'bao' => 'CRM_Core_BAO_ActionSchedule',
606 'recipient_manual' => [
607 'name' => 'recipient_manual',
608 'type' => CRM_Utils_Type
::T_STRING
,
609 'title' => ts('Recipient Manual'),
610 'description' => ts('Contact IDs to which reminder should be sent.'),
612 'size' => CRM_Utils_Type
::HUGE
,
613 'where' => 'civicrm_action_schedule.recipient_manual',
614 'table_name' => 'civicrm_action_schedule',
615 'entity' => 'ActionSchedule',
616 'bao' => 'CRM_Core_BAO_ActionSchedule',
620 'recipient_listing' => [
621 'name' => 'recipient_listing',
622 'type' => CRM_Utils_Type
::T_STRING
,
623 'title' => ts('Recipient Listing'),
624 'description' => ts('listing based on recipient field.'),
626 'size' => CRM_Utils_Type
::HUGE
,
627 'where' => 'civicrm_action_schedule.recipient_listing',
628 'table_name' => 'civicrm_action_schedule',
629 'entity' => 'ActionSchedule',
630 'bao' => 'CRM_Core_BAO_ActionSchedule',
635 'name' => 'body_text',
636 'type' => CRM_Utils_Type
::T_LONGTEXT
,
637 'title' => ts('Reminder Text'),
638 'description' => ts('Body of the mailing in text format.'),
639 'where' => 'civicrm_action_schedule.body_text',
640 'table_name' => 'civicrm_action_schedule',
641 'entity' => 'ActionSchedule',
642 'bao' => 'CRM_Core_BAO_ActionSchedule',
647 'name' => 'body_html',
648 'type' => CRM_Utils_Type
::T_LONGTEXT
,
649 'title' => ts('Reminder HTML'),
650 'description' => ts('Body of the mailing in html format.'),
651 'where' => 'civicrm_action_schedule.body_html',
652 'table_name' => 'civicrm_action_schedule',
653 'entity' => 'ActionSchedule',
654 'bao' => 'CRM_Core_BAO_ActionSchedule',
659 'name' => 'sms_body_text',
660 'type' => CRM_Utils_Type
::T_LONGTEXT
,
661 'title' => ts('SMS Reminder Text'),
662 'description' => ts('Content of the SMS text.'),
663 'where' => 'civicrm_action_schedule.sms_body_text',
664 'table_name' => 'civicrm_action_schedule',
665 'entity' => 'ActionSchedule',
666 'bao' => 'CRM_Core_BAO_ActionSchedule',
672 'type' => CRM_Utils_Type
::T_STRING
,
673 'title' => ts('Reminder Subject'),
674 'description' => ts('Subject of mailing'),
676 'size' => CRM_Utils_Type
::HUGE
,
677 'where' => 'civicrm_action_schedule.subject',
678 'table_name' => 'civicrm_action_schedule',
679 'entity' => 'ActionSchedule',
680 'bao' => 'CRM_Core_BAO_ActionSchedule',
684 'record_activity' => [
685 'name' => 'record_activity',
686 'type' => CRM_Utils_Type
::T_BOOLEAN
,
687 'title' => ts('Record Activity for Reminder?'),
688 'description' => ts('Record Activity for this reminder?'),
689 'where' => 'civicrm_action_schedule.record_activity',
691 'table_name' => 'civicrm_action_schedule',
692 'entity' => 'ActionSchedule',
693 'bao' => 'CRM_Core_BAO_ActionSchedule',
698 'name' => 'mapping_id',
699 'type' => CRM_Utils_Type
::T_STRING
,
700 'title' => ts('Reminder Mapping'),
701 'description' => ts('Name/ID of the mapping to use on this table'),
703 'size' => CRM_Utils_Type
::BIG
,
704 'where' => 'civicrm_action_schedule.mapping_id',
705 'table_name' => 'civicrm_action_schedule',
706 'entity' => 'ActionSchedule',
707 'bao' => 'CRM_Core_BAO_ActionSchedule',
712 'name' => 'group_id',
713 'type' => CRM_Utils_Type
::T_INT
,
714 'title' => ts('Reminder Group'),
715 'description' => ts('FK to Group'),
716 'where' => 'civicrm_action_schedule.group_id',
717 'table_name' => 'civicrm_action_schedule',
718 'entity' => 'ActionSchedule',
719 'bao' => 'CRM_Core_BAO_ActionSchedule',
721 'FKClassName' => 'CRM_Contact_DAO_Group',
725 'pseudoconstant' => [
726 'table' => 'civicrm_group',
728 'labelColumn' => 'title',
732 'msg_template_id' => [
733 'name' => 'msg_template_id',
734 'type' => CRM_Utils_Type
::T_INT
,
735 'title' => ts('Reminder Template'),
736 'description' => ts('FK to the message template.'),
737 'where' => 'civicrm_action_schedule.msg_template_id',
738 'table_name' => 'civicrm_action_schedule',
739 'entity' => 'ActionSchedule',
740 'bao' => 'CRM_Core_BAO_ActionSchedule',
742 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
745 'sms_template_id' => [
746 'name' => 'sms_template_id',
747 'type' => CRM_Utils_Type
::T_INT
,
748 'title' => ts('SMS Reminder Template'),
749 'description' => ts('FK to the message template.'),
750 'where' => 'civicrm_action_schedule.sms_template_id',
751 'table_name' => 'civicrm_action_schedule',
752 'entity' => 'ActionSchedule',
753 'bao' => 'CRM_Core_BAO_ActionSchedule',
755 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
759 'name' => 'absolute_date',
760 'type' => CRM_Utils_Type
::T_DATE
,
761 'title' => ts('Fixed Date for Reminder'),
762 'description' => ts('Date on which the reminder be sent.'),
763 'where' => 'civicrm_action_schedule.absolute_date',
764 'table_name' => 'civicrm_action_schedule',
765 'entity' => 'ActionSchedule',
766 'bao' => 'CRM_Core_BAO_ActionSchedule',
771 'name' => 'from_name',
772 'type' => CRM_Utils_Type
::T_STRING
,
773 'title' => ts('Reminder from Name'),
774 'description' => ts('Name in "from" field'),
776 'size' => CRM_Utils_Type
::HUGE
,
777 'where' => 'civicrm_action_schedule.from_name',
778 'table_name' => 'civicrm_action_schedule',
779 'entity' => 'ActionSchedule',
780 'bao' => 'CRM_Core_BAO_ActionSchedule',
785 'name' => 'from_email',
786 'type' => CRM_Utils_Type
::T_STRING
,
787 'title' => ts('Reminder From Email'),
788 'description' => ts('Email address in "from" field'),
790 'size' => CRM_Utils_Type
::HUGE
,
791 'where' => 'civicrm_action_schedule.from_email',
792 'table_name' => 'civicrm_action_schedule',
793 'entity' => 'ActionSchedule',
794 'bao' => 'CRM_Core_BAO_ActionSchedule',
800 'type' => CRM_Utils_Type
::T_STRING
,
801 'title' => ts('Message Mode'),
802 'description' => ts('Send the message as email or sms or both.'),
804 'size' => CRM_Utils_Type
::HUGE
,
805 'where' => 'civicrm_action_schedule.mode',
806 'default' => 'Email',
807 'table_name' => 'civicrm_action_schedule',
808 'entity' => 'ActionSchedule',
809 'bao' => 'CRM_Core_BAO_ActionSchedule',
814 'pseudoconstant' => [
815 'optionGroupName' => 'msg_mode',
816 'optionEditPath' => 'civicrm/admin/options/msg_mode',
820 'sms_provider_id' => [
821 'name' => 'sms_provider_id',
822 'type' => CRM_Utils_Type
::T_INT
,
823 'title' => ts('SMS Provider'),
824 'where' => 'civicrm_action_schedule.sms_provider_id',
825 'table_name' => 'civicrm_action_schedule',
826 'entity' => 'ActionSchedule',
827 'bao' => 'CRM_Core_BAO_ActionSchedule',
829 'FKClassName' => 'CRM_SMS_DAO_Provider',
836 'name' => 'used_for',
837 'type' => CRM_Utils_Type
::T_STRING
,
838 'title' => ts('Used For'),
839 'description' => ts('Used for repeating entity'),
841 'size' => CRM_Utils_Type
::BIG
,
842 'where' => 'civicrm_action_schedule.used_for',
843 'table_name' => 'civicrm_action_schedule',
844 'entity' => 'ActionSchedule',
845 'bao' => 'CRM_Core_BAO_ActionSchedule',
849 'filter_contact_language' => [
850 'name' => 'filter_contact_language',
851 'type' => CRM_Utils_Type
::T_STRING
,
852 'title' => ts('Filter Contact Language'),
853 'description' => ts('Used for multilingual installation'),
855 'size' => CRM_Utils_Type
::HUGE
,
856 'where' => 'civicrm_action_schedule.filter_contact_language',
857 'table_name' => 'civicrm_action_schedule',
858 'entity' => 'ActionSchedule',
859 'bao' => 'CRM_Core_BAO_ActionSchedule',
863 'communication_language' => [
864 'name' => 'communication_language',
865 'type' => CRM_Utils_Type
::T_STRING
,
866 'title' => ts('Communication Language'),
867 'description' => ts('Used for multilingual installation'),
869 'size' => CRM_Utils_Type
::EIGHT
,
870 'where' => 'civicrm_action_schedule.communication_language',
871 'table_name' => 'civicrm_action_schedule',
872 'entity' => 'ActionSchedule',
873 'bao' => 'CRM_Core_BAO_ActionSchedule',
878 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
880 return Civi
::$statics[__CLASS__
]['fields'];
884 * Return a mapping from field-name to the corresponding key (as used in fields()).
887 * Array(string $name => string $uniqueName).
889 public static function &fieldKeys() {
890 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
891 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
893 return Civi
::$statics[__CLASS__
]['fieldKeys'];
897 * Returns the names of this table
901 public static function getTableName() {
902 return self
::$_tableName;
906 * Returns if this table needs to be logged
910 public function getLog() {
915 * Returns the list of fields that can be imported
917 * @param bool $prefix
921 public static function &import($prefix = FALSE) {
922 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'action_schedule', $prefix, []);
927 * Returns the list of fields that can be exported
929 * @param bool $prefix
933 public static function &export($prefix = FALSE) {
934 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'action_schedule', $prefix, []);
939 * Returns the list of indices
941 * @param bool $localize
945 public static function indices($localize = TRUE) {
947 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;