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:77bfa18590c85ad7b6430c018acd508c)
13 * Database access object for the ActionSchedule entity.
15 class CRM_Core_DAO_ActionSchedule
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.4';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_action_schedule';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
39 * Name of the action(reminder)
46 * Title of the action(reminder)
60 * Is this the recipient criteria limited to OR in addition to?
78 public $entity_status;
85 public $start_action_offset;
88 * Time units for reminder.
92 public $start_action_unit;
99 public $start_action_condition;
106 public $start_action_date;
114 * Time units for repetition of reminder.
118 public $repetition_frequency_unit;
121 * Time interval for repeating the reminder.
125 public $repetition_frequency_interval;
128 * Time units till repetition of reminder.
132 public $end_frequency_unit;
135 * Time interval till repeating the reminder.
139 public $end_frequency_interval;
142 * Reminder Action till repeating the reminder.
156 * Is this option active?
163 * Contact IDs to which reminder should be sent.
167 public $recipient_manual;
170 * listing based on recipient field.
174 public $recipient_listing;
177 * Body of the mailing in text format.
184 * Body of the mailing in html format.
191 * Content of the SMS text.
195 public $sms_body_text;
205 * Record Activity for this reminder?
209 public $record_activity;
212 * Name/ID of the mapping to use on this table
226 * FK to the message template.
230 public $msg_template_id;
233 * FK to the message template.
237 public $sms_template_id;
240 * Date on which the reminder be sent.
244 public $absolute_date;
247 * Name in "from" field
254 * Email address in "from" field
261 * Send the message as email or sms or both.
270 public $sms_provider_id;
273 * Used for repeating entity
280 * Used for multilingual installation
284 public $filter_contact_language;
287 * Used for multilingual installation
291 public $communication_language;
296 public function __construct() {
297 $this->__table
= 'civicrm_action_schedule';
298 parent
::__construct();
302 * Returns localized title of this entity.
304 * @param bool $plural
305 * Whether to return the plural version of the title.
307 public static function getEntityTitle($plural = FALSE) {
308 return $plural ?
ts('Action Schedules') : ts('Action Schedule');
312 * Returns foreign keys and entity references.
315 * [CRM_Core_Reference_Interface]
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']);
326 return Civi
::$statics[__CLASS__
]['links'];
330 * Returns all the column names of this table
334 public static function &fields() {
335 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
336 Civi
::$statics[__CLASS__
]['fields'] = [
339 'type' => CRM_Utils_Type
::T_INT
,
340 'title' => ts('Action Schedule ID'),
342 'where' => 'civicrm_action_schedule.id',
343 'table_name' => 'civicrm_action_schedule',
344 'entity' => 'ActionSchedule',
345 'bao' => 'CRM_Core_BAO_ActionSchedule',
351 'type' => CRM_Utils_Type
::T_STRING
,
352 'title' => ts('Name'),
353 'description' => ts('Name of the action(reminder)'),
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',
365 'type' => CRM_Utils_Type
::T_STRING
,
366 'title' => ts('Title'),
367 'description' => ts('Title of the action(reminder)'),
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',
378 'name' => 'recipient',
379 'type' => CRM_Utils_Type
::T_STRING
,
380 'title' => ts('Recipient'),
381 'description' => ts('Recipient'),
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',
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',
404 'name' => 'entity_value',
405 'type' => CRM_Utils_Type
::T_STRING
,
406 'title' => ts('Entity Value'),
407 'description' => ts('Entity value'),
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',
415 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
419 'name' => 'entity_status',
420 'type' => CRM_Utils_Type
::T_STRING
,
421 'title' => ts('Entity Status'),
422 'description' => ts('Entity status'),
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',
430 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
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',
440 'table_name' => 'civicrm_action_schedule',
441 'entity' => 'ActionSchedule',
442 'bao' => 'CRM_Core_BAO_ActionSchedule',
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.'),
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',
461 'pseudoconstant' => [
462 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
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'),
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',
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'),
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',
495 'name' => 'is_repeat',
496 'type' => CRM_Utils_Type
::T_BOOLEAN
,
497 'title' => ts('Repeat?'),
498 'where' => 'civicrm_action_schedule.is_repeat',
500 'table_name' => 'civicrm_action_schedule',
501 'entity' => 'ActionSchedule',
502 'bao' => 'CRM_Core_BAO_ActionSchedule',
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.'),
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',
521 'pseudoconstant' => [
522 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
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',
533 'table_name' => 'civicrm_action_schedule',
534 'entity' => 'ActionSchedule',
535 'bao' => 'CRM_Core_BAO_ActionSchedule',
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.'),
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',
554 'pseudoconstant' => [
555 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
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',
566 'table_name' => 'civicrm_action_schedule',
567 'entity' => 'ActionSchedule',
568 'bao' => 'CRM_Core_BAO_ActionSchedule',
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.'),
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',
587 'name' => 'end_date',
588 'type' => CRM_Utils_Type
::T_STRING
,
589 'title' => ts('End Date'),
590 'description' => ts('Entity end date'),
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',
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',
607 'table_name' => 'civicrm_action_schedule',
608 'entity' => 'ActionSchedule',
609 'bao' => 'CRM_Core_BAO_ActionSchedule',
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.'),
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',
625 'serialize' => self
::SERIALIZE_COMMA
,
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.'),
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',
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',
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',
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',
680 'type' => CRM_Utils_Type
::T_STRING
,
681 'title' => ts('Reminder Subject'),
682 'description' => ts('Subject of mailing'),
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',
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',
699 'table_name' => 'civicrm_action_schedule',
700 'entity' => 'ActionSchedule',
701 'bao' => 'CRM_Core_BAO_ActionSchedule',
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'),
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',
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',
729 'FKClassName' => 'CRM_Contact_DAO_Group',
733 'pseudoconstant' => [
734 'table' => 'civicrm_group',
736 'labelColumn' => 'title',
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',
750 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
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',
763 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
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',
779 'name' => 'from_name',
780 'type' => CRM_Utils_Type
::T_STRING
,
781 'title' => ts('Reminder from Name'),
782 'description' => ts('Name in "from" field'),
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',
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'),
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',
808 'type' => CRM_Utils_Type
::T_STRING
,
809 'title' => ts('Message Mode'),
810 'description' => ts('Send the message as email or sms or both.'),
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',
822 'pseudoconstant' => [
823 'optionGroupName' => 'msg_mode',
824 'optionEditPath' => 'civicrm/admin/options/msg_mode',
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',
837 'FKClassName' => 'CRM_SMS_DAO_Provider',
844 'name' => 'used_for',
845 'type' => CRM_Utils_Type
::T_STRING
,
846 'title' => ts('Used For'),
847 'description' => ts('Used for repeating entity'),
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',
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'),
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',
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'),
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',
886 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
888 return Civi
::$statics[__CLASS__
]['fields'];
892 * Return a mapping from field-name to the corresponding key (as used in fields()).
895 * Array(string $name => string $uniqueName).
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()));
901 return Civi
::$statics[__CLASS__
]['fieldKeys'];
905 * Returns the names of this table
909 public static function getTableName() {
910 return self
::$_tableName;
914 * Returns if this table needs to be logged
918 public function getLog() {
923 * Returns the list of fields that can be imported
925 * @param bool $prefix
929 public static function &import($prefix = FALSE) {
930 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'action_schedule', $prefix, []);
935 * Returns the list of fields that can be exported
937 * @param bool $prefix
941 public static function &export($prefix = FALSE) {
942 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'action_schedule', $prefix, []);
947 * Returns the list of indices
949 * @param bool $localize
953 public static function indices($localize = TRUE) {
955 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;