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:d05639de89f460efbb3474dcaf5acd27)
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 public static function getEntityTitle() {
305 return ts('Action Schedules');
309 * Returns foreign keys and entity references.
312 * [CRM_Core_Reference_Interface]
314 public static function getReferenceColumns() {
315 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
316 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
317 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'group_id', 'civicrm_group', 'id');
318 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id');
319 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'sms_template_id', 'civicrm_msg_template', 'id');
320 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id');
321 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
323 return Civi
::$statics[__CLASS__
]['links'];
327 * Returns all the column names of this table
331 public static function &fields() {
332 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
333 Civi
::$statics[__CLASS__
]['fields'] = [
336 'type' => CRM_Utils_Type
::T_INT
,
337 'title' => ts('Action Schedule ID'),
339 'where' => 'civicrm_action_schedule.id',
340 'table_name' => 'civicrm_action_schedule',
341 'entity' => 'ActionSchedule',
342 'bao' => 'CRM_Core_BAO_ActionSchedule',
348 'type' => CRM_Utils_Type
::T_STRING
,
349 'title' => ts('Name'),
350 'description' => ts('Name of the action(reminder)'),
352 'size' => CRM_Utils_Type
::BIG
,
353 'where' => 'civicrm_action_schedule.name',
354 'table_name' => 'civicrm_action_schedule',
355 'entity' => 'ActionSchedule',
356 'bao' => 'CRM_Core_BAO_ActionSchedule',
362 'type' => CRM_Utils_Type
::T_STRING
,
363 'title' => ts('Title'),
364 'description' => ts('Title of the action(reminder)'),
366 'size' => CRM_Utils_Type
::BIG
,
367 'where' => 'civicrm_action_schedule.title',
368 'table_name' => 'civicrm_action_schedule',
369 'entity' => 'ActionSchedule',
370 'bao' => 'CRM_Core_BAO_ActionSchedule',
375 'name' => 'recipient',
376 'type' => CRM_Utils_Type
::T_STRING
,
377 'title' => ts('Recipient'),
378 'description' => ts('Recipient'),
380 'size' => CRM_Utils_Type
::BIG
,
381 'where' => 'civicrm_action_schedule.recipient',
382 'table_name' => 'civicrm_action_schedule',
383 'entity' => 'ActionSchedule',
384 'bao' => 'CRM_Core_BAO_ActionSchedule',
389 'name' => 'limit_to',
390 'type' => CRM_Utils_Type
::T_BOOLEAN
,
391 'title' => ts('Limit To'),
392 'description' => ts('Is this the recipient criteria limited to OR in addition to?'),
393 'where' => 'civicrm_action_schedule.limit_to',
394 'table_name' => 'civicrm_action_schedule',
395 'entity' => 'ActionSchedule',
396 'bao' => 'CRM_Core_BAO_ActionSchedule',
401 'name' => 'entity_value',
402 'type' => CRM_Utils_Type
::T_STRING
,
403 'title' => ts('Entity Value'),
404 'description' => ts('Entity value'),
406 'size' => CRM_Utils_Type
::HUGE
,
407 'where' => 'civicrm_action_schedule.entity_value',
408 'table_name' => 'civicrm_action_schedule',
409 'entity' => 'ActionSchedule',
410 'bao' => 'CRM_Core_BAO_ActionSchedule',
412 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
416 'name' => 'entity_status',
417 'type' => CRM_Utils_Type
::T_STRING
,
418 'title' => ts('Entity Status'),
419 'description' => ts('Entity status'),
421 'size' => CRM_Utils_Type
::BIG
,
422 'where' => 'civicrm_action_schedule.entity_status',
423 'table_name' => 'civicrm_action_schedule',
424 'entity' => 'ActionSchedule',
425 'bao' => 'CRM_Core_BAO_ActionSchedule',
427 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
430 'start_action_offset' => [
431 'name' => 'start_action_offset',
432 'type' => CRM_Utils_Type
::T_INT
,
433 'title' => ts('Start Action Offset'),
434 'description' => ts('Reminder Interval.'),
435 'where' => 'civicrm_action_schedule.start_action_offset',
437 'table_name' => 'civicrm_action_schedule',
438 'entity' => 'ActionSchedule',
439 'bao' => 'CRM_Core_BAO_ActionSchedule',
443 'start_action_unit' => [
444 'name' => 'start_action_unit',
445 'type' => CRM_Utils_Type
::T_STRING
,
446 'title' => ts('Start Action Unit'),
447 'description' => ts('Time units for reminder.'),
449 'size' => CRM_Utils_Type
::EIGHT
,
450 'where' => 'civicrm_action_schedule.start_action_unit',
451 'table_name' => 'civicrm_action_schedule',
452 'entity' => 'ActionSchedule',
453 'bao' => 'CRM_Core_BAO_ActionSchedule',
458 'pseudoconstant' => [
459 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
463 'start_action_condition' => [
464 'name' => 'start_action_condition',
465 'type' => CRM_Utils_Type
::T_STRING
,
466 'title' => ts('Start Action Condition'),
467 'description' => ts('Reminder Action'),
469 'size' => CRM_Utils_Type
::BIG
,
470 'where' => 'civicrm_action_schedule.start_action_condition',
471 'table_name' => 'civicrm_action_schedule',
472 'entity' => 'ActionSchedule',
473 'bao' => 'CRM_Core_BAO_ActionSchedule',
477 'start_action_date' => [
478 'name' => 'start_action_date',
479 'type' => CRM_Utils_Type
::T_STRING
,
480 'title' => ts('Start Action Date'),
481 'description' => ts('Entity date'),
483 'size' => CRM_Utils_Type
::BIG
,
484 'where' => 'civicrm_action_schedule.start_action_date',
485 'table_name' => 'civicrm_action_schedule',
486 'entity' => 'ActionSchedule',
487 'bao' => 'CRM_Core_BAO_ActionSchedule',
492 'name' => 'is_repeat',
493 'type' => CRM_Utils_Type
::T_BOOLEAN
,
494 'title' => ts('Repeat?'),
495 'where' => 'civicrm_action_schedule.is_repeat',
497 'table_name' => 'civicrm_action_schedule',
498 'entity' => 'ActionSchedule',
499 'bao' => 'CRM_Core_BAO_ActionSchedule',
503 'repetition_frequency_unit' => [
504 'name' => 'repetition_frequency_unit',
505 'type' => CRM_Utils_Type
::T_STRING
,
506 'title' => ts('Repetition Frequency Unit'),
507 'description' => ts('Time units for repetition of reminder.'),
509 'size' => CRM_Utils_Type
::EIGHT
,
510 'where' => 'civicrm_action_schedule.repetition_frequency_unit',
511 'table_name' => 'civicrm_action_schedule',
512 'entity' => 'ActionSchedule',
513 'bao' => 'CRM_Core_BAO_ActionSchedule',
518 'pseudoconstant' => [
519 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
523 'repetition_frequency_interval' => [
524 'name' => 'repetition_frequency_interval',
525 'type' => CRM_Utils_Type
::T_INT
,
526 'title' => ts('Repetition Frequency Interval'),
527 'description' => ts('Time interval for repeating the reminder.'),
528 'where' => 'civicrm_action_schedule.repetition_frequency_interval',
530 'table_name' => 'civicrm_action_schedule',
531 'entity' => 'ActionSchedule',
532 'bao' => 'CRM_Core_BAO_ActionSchedule',
536 'end_frequency_unit' => [
537 'name' => 'end_frequency_unit',
538 'type' => CRM_Utils_Type
::T_STRING
,
539 'title' => ts('End Frequency Unit'),
540 'description' => ts('Time units till repetition of reminder.'),
542 'size' => CRM_Utils_Type
::EIGHT
,
543 'where' => 'civicrm_action_schedule.end_frequency_unit',
544 'table_name' => 'civicrm_action_schedule',
545 'entity' => 'ActionSchedule',
546 'bao' => 'CRM_Core_BAO_ActionSchedule',
551 'pseudoconstant' => [
552 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
556 'end_frequency_interval' => [
557 'name' => 'end_frequency_interval',
558 'type' => CRM_Utils_Type
::T_INT
,
559 'title' => ts('End Frequency Interval'),
560 'description' => ts('Time interval till repeating the reminder.'),
561 'where' => 'civicrm_action_schedule.end_frequency_interval',
563 'table_name' => 'civicrm_action_schedule',
564 'entity' => 'ActionSchedule',
565 'bao' => 'CRM_Core_BAO_ActionSchedule',
570 'name' => 'end_action',
571 'type' => CRM_Utils_Type
::T_STRING
,
572 'title' => ts('End Action'),
573 'description' => ts('Reminder Action till repeating the reminder.'),
575 'size' => CRM_Utils_Type
::MEDIUM
,
576 'where' => 'civicrm_action_schedule.end_action',
577 'table_name' => 'civicrm_action_schedule',
578 'entity' => 'ActionSchedule',
579 'bao' => 'CRM_Core_BAO_ActionSchedule',
584 'name' => 'end_date',
585 'type' => CRM_Utils_Type
::T_STRING
,
586 'title' => ts('End Date'),
587 'description' => ts('Entity end date'),
589 'size' => CRM_Utils_Type
::BIG
,
590 'where' => 'civicrm_action_schedule.end_date',
591 'table_name' => 'civicrm_action_schedule',
592 'entity' => 'ActionSchedule',
593 'bao' => 'CRM_Core_BAO_ActionSchedule',
598 'name' => 'is_active',
599 'type' => CRM_Utils_Type
::T_BOOLEAN
,
600 'title' => ts('Schedule is Active?'),
601 'description' => ts('Is this option active?'),
602 'where' => 'civicrm_action_schedule.is_active',
604 'table_name' => 'civicrm_action_schedule',
605 'entity' => 'ActionSchedule',
606 'bao' => 'CRM_Core_BAO_ActionSchedule',
610 'recipient_manual' => [
611 'name' => 'recipient_manual',
612 'type' => CRM_Utils_Type
::T_STRING
,
613 'title' => ts('Recipient Manual'),
614 'description' => ts('Contact IDs to which reminder should be sent.'),
616 'size' => CRM_Utils_Type
::HUGE
,
617 'where' => 'civicrm_action_schedule.recipient_manual',
618 'table_name' => 'civicrm_action_schedule',
619 'entity' => 'ActionSchedule',
620 'bao' => 'CRM_Core_BAO_ActionSchedule',
622 'serialize' => self
::SERIALIZE_COMMA
,
625 'recipient_listing' => [
626 'name' => 'recipient_listing',
627 'type' => CRM_Utils_Type
::T_STRING
,
628 'title' => ts('Recipient Listing'),
629 'description' => ts('listing based on recipient field.'),
631 'size' => CRM_Utils_Type
::HUGE
,
632 'where' => 'civicrm_action_schedule.recipient_listing',
633 'table_name' => 'civicrm_action_schedule',
634 'entity' => 'ActionSchedule',
635 'bao' => 'CRM_Core_BAO_ActionSchedule',
640 'name' => 'body_text',
641 'type' => CRM_Utils_Type
::T_LONGTEXT
,
642 'title' => ts('Reminder Text'),
643 'description' => ts('Body of the mailing in text format.'),
644 'where' => 'civicrm_action_schedule.body_text',
645 'table_name' => 'civicrm_action_schedule',
646 'entity' => 'ActionSchedule',
647 'bao' => 'CRM_Core_BAO_ActionSchedule',
652 'name' => 'body_html',
653 'type' => CRM_Utils_Type
::T_LONGTEXT
,
654 'title' => ts('Reminder HTML'),
655 'description' => ts('Body of the mailing in html format.'),
656 'where' => 'civicrm_action_schedule.body_html',
657 'table_name' => 'civicrm_action_schedule',
658 'entity' => 'ActionSchedule',
659 'bao' => 'CRM_Core_BAO_ActionSchedule',
664 'name' => 'sms_body_text',
665 'type' => CRM_Utils_Type
::T_LONGTEXT
,
666 'title' => ts('SMS Reminder Text'),
667 'description' => ts('Content of the SMS text.'),
668 'where' => 'civicrm_action_schedule.sms_body_text',
669 'table_name' => 'civicrm_action_schedule',
670 'entity' => 'ActionSchedule',
671 'bao' => 'CRM_Core_BAO_ActionSchedule',
677 'type' => CRM_Utils_Type
::T_STRING
,
678 'title' => ts('Reminder Subject'),
679 'description' => ts('Subject of mailing'),
681 'size' => CRM_Utils_Type
::HUGE
,
682 'where' => 'civicrm_action_schedule.subject',
683 'table_name' => 'civicrm_action_schedule',
684 'entity' => 'ActionSchedule',
685 'bao' => 'CRM_Core_BAO_ActionSchedule',
689 'record_activity' => [
690 'name' => 'record_activity',
691 'type' => CRM_Utils_Type
::T_BOOLEAN
,
692 'title' => ts('Record Activity for Reminder?'),
693 'description' => ts('Record Activity for this reminder?'),
694 'where' => 'civicrm_action_schedule.record_activity',
696 'table_name' => 'civicrm_action_schedule',
697 'entity' => 'ActionSchedule',
698 'bao' => 'CRM_Core_BAO_ActionSchedule',
703 'name' => 'mapping_id',
704 'type' => CRM_Utils_Type
::T_STRING
,
705 'title' => ts('Reminder Mapping'),
706 'description' => ts('Name/ID of the mapping to use on this table'),
708 'size' => CRM_Utils_Type
::BIG
,
709 'where' => 'civicrm_action_schedule.mapping_id',
710 'table_name' => 'civicrm_action_schedule',
711 'entity' => 'ActionSchedule',
712 'bao' => 'CRM_Core_BAO_ActionSchedule',
717 'name' => 'group_id',
718 'type' => CRM_Utils_Type
::T_INT
,
719 'title' => ts('Reminder Group'),
720 'description' => ts('FK to Group'),
721 'where' => 'civicrm_action_schedule.group_id',
722 'table_name' => 'civicrm_action_schedule',
723 'entity' => 'ActionSchedule',
724 'bao' => 'CRM_Core_BAO_ActionSchedule',
726 'FKClassName' => 'CRM_Contact_DAO_Group',
730 'pseudoconstant' => [
731 'table' => 'civicrm_group',
733 'labelColumn' => 'title',
737 'msg_template_id' => [
738 'name' => 'msg_template_id',
739 'type' => CRM_Utils_Type
::T_INT
,
740 'title' => ts('Reminder Template'),
741 'description' => ts('FK to the message template.'),
742 'where' => 'civicrm_action_schedule.msg_template_id',
743 'table_name' => 'civicrm_action_schedule',
744 'entity' => 'ActionSchedule',
745 'bao' => 'CRM_Core_BAO_ActionSchedule',
747 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
750 'sms_template_id' => [
751 'name' => 'sms_template_id',
752 'type' => CRM_Utils_Type
::T_INT
,
753 'title' => ts('SMS Reminder Template'),
754 'description' => ts('FK to the message template.'),
755 'where' => 'civicrm_action_schedule.sms_template_id',
756 'table_name' => 'civicrm_action_schedule',
757 'entity' => 'ActionSchedule',
758 'bao' => 'CRM_Core_BAO_ActionSchedule',
760 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
764 'name' => 'absolute_date',
765 'type' => CRM_Utils_Type
::T_DATE
,
766 'title' => ts('Fixed Date for Reminder'),
767 'description' => ts('Date on which the reminder be sent.'),
768 'where' => 'civicrm_action_schedule.absolute_date',
769 'table_name' => 'civicrm_action_schedule',
770 'entity' => 'ActionSchedule',
771 'bao' => 'CRM_Core_BAO_ActionSchedule',
776 'name' => 'from_name',
777 'type' => CRM_Utils_Type
::T_STRING
,
778 'title' => ts('Reminder from Name'),
779 'description' => ts('Name in "from" field'),
781 'size' => CRM_Utils_Type
::HUGE
,
782 'where' => 'civicrm_action_schedule.from_name',
783 'table_name' => 'civicrm_action_schedule',
784 'entity' => 'ActionSchedule',
785 'bao' => 'CRM_Core_BAO_ActionSchedule',
790 'name' => 'from_email',
791 'type' => CRM_Utils_Type
::T_STRING
,
792 'title' => ts('Reminder From Email'),
793 'description' => ts('Email address in "from" field'),
795 'size' => CRM_Utils_Type
::HUGE
,
796 'where' => 'civicrm_action_schedule.from_email',
797 'table_name' => 'civicrm_action_schedule',
798 'entity' => 'ActionSchedule',
799 'bao' => 'CRM_Core_BAO_ActionSchedule',
805 'type' => CRM_Utils_Type
::T_STRING
,
806 'title' => ts('Message Mode'),
807 'description' => ts('Send the message as email or sms or both.'),
809 'size' => CRM_Utils_Type
::HUGE
,
810 'where' => 'civicrm_action_schedule.mode',
811 'default' => 'Email',
812 'table_name' => 'civicrm_action_schedule',
813 'entity' => 'ActionSchedule',
814 'bao' => 'CRM_Core_BAO_ActionSchedule',
819 'pseudoconstant' => [
820 'optionGroupName' => 'msg_mode',
821 'optionEditPath' => 'civicrm/admin/options/msg_mode',
825 'sms_provider_id' => [
826 'name' => 'sms_provider_id',
827 'type' => CRM_Utils_Type
::T_INT
,
828 'title' => ts('SMS Provider'),
829 'where' => 'civicrm_action_schedule.sms_provider_id',
830 'table_name' => 'civicrm_action_schedule',
831 'entity' => 'ActionSchedule',
832 'bao' => 'CRM_Core_BAO_ActionSchedule',
834 'FKClassName' => 'CRM_SMS_DAO_Provider',
841 'name' => 'used_for',
842 'type' => CRM_Utils_Type
::T_STRING
,
843 'title' => ts('Used For'),
844 'description' => ts('Used for repeating entity'),
846 'size' => CRM_Utils_Type
::BIG
,
847 'where' => 'civicrm_action_schedule.used_for',
848 'table_name' => 'civicrm_action_schedule',
849 'entity' => 'ActionSchedule',
850 'bao' => 'CRM_Core_BAO_ActionSchedule',
854 'filter_contact_language' => [
855 'name' => 'filter_contact_language',
856 'type' => CRM_Utils_Type
::T_STRING
,
857 'title' => ts('Filter Contact Language'),
858 'description' => ts('Used for multilingual installation'),
860 'size' => CRM_Utils_Type
::HUGE
,
861 'where' => 'civicrm_action_schedule.filter_contact_language',
862 'table_name' => 'civicrm_action_schedule',
863 'entity' => 'ActionSchedule',
864 'bao' => 'CRM_Core_BAO_ActionSchedule',
868 'communication_language' => [
869 'name' => 'communication_language',
870 'type' => CRM_Utils_Type
::T_STRING
,
871 'title' => ts('Communication Language'),
872 'description' => ts('Used for multilingual installation'),
874 'size' => CRM_Utils_Type
::EIGHT
,
875 'where' => 'civicrm_action_schedule.communication_language',
876 'table_name' => 'civicrm_action_schedule',
877 'entity' => 'ActionSchedule',
878 'bao' => 'CRM_Core_BAO_ActionSchedule',
883 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
885 return Civi
::$statics[__CLASS__
]['fields'];
889 * Return a mapping from field-name to the corresponding key (as used in fields()).
892 * Array(string $name => string $uniqueName).
894 public static function &fieldKeys() {
895 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
896 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
898 return Civi
::$statics[__CLASS__
]['fieldKeys'];
902 * Returns the names of this table
906 public static function getTableName() {
907 return self
::$_tableName;
911 * Returns if this table needs to be logged
915 public function getLog() {
920 * Returns the list of fields that can be imported
922 * @param bool $prefix
926 public static function &import($prefix = FALSE) {
927 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'action_schedule', $prefix, []);
932 * Returns the list of fields that can be exported
934 * @param bool $prefix
938 public static function &export($prefix = FALSE) {
939 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'action_schedule', $prefix, []);
944 * Returns the list of indices
946 * @param bool $localize
950 public static function indices($localize = TRUE) {
952 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;