5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/ActionSchedule.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:cb2618343c279fbf0baabe1f1ebd9973)
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 foreign keys and entity references.
303 * [CRM_Core_Reference_Interface]
305 public static function getReferenceColumns() {
306 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
307 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
308 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'group_id', 'civicrm_group', 'id');
309 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id');
310 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'sms_template_id', 'civicrm_msg_template', 'id');
311 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id');
312 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
314 return Civi
::$statics[__CLASS__
]['links'];
318 * Returns all the column names of this table
322 public static function &fields() {
323 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
324 Civi
::$statics[__CLASS__
]['fields'] = [
327 'type' => CRM_Utils_Type
::T_INT
,
328 'title' => ts('Action Schedule ID'),
330 'where' => 'civicrm_action_schedule.id',
331 'table_name' => 'civicrm_action_schedule',
332 'entity' => 'ActionSchedule',
333 'bao' => 'CRM_Core_BAO_ActionSchedule',
338 'type' => CRM_Utils_Type
::T_STRING
,
339 'title' => ts('Name'),
340 'description' => ts('Name of the action(reminder)'),
342 'size' => CRM_Utils_Type
::BIG
,
343 'where' => 'civicrm_action_schedule.name',
344 'table_name' => 'civicrm_action_schedule',
345 'entity' => 'ActionSchedule',
346 'bao' => 'CRM_Core_BAO_ActionSchedule',
351 'type' => CRM_Utils_Type
::T_STRING
,
352 'title' => ts('Title'),
353 'description' => ts('Title of the action(reminder)'),
355 'size' => CRM_Utils_Type
::BIG
,
356 'where' => 'civicrm_action_schedule.title',
357 'table_name' => 'civicrm_action_schedule',
358 'entity' => 'ActionSchedule',
359 'bao' => 'CRM_Core_BAO_ActionSchedule',
363 'name' => 'recipient',
364 'type' => CRM_Utils_Type
::T_STRING
,
365 'title' => ts('Recipient'),
366 'description' => ts('Recipient'),
368 'size' => CRM_Utils_Type
::BIG
,
369 'where' => 'civicrm_action_schedule.recipient',
370 'table_name' => 'civicrm_action_schedule',
371 'entity' => 'ActionSchedule',
372 'bao' => 'CRM_Core_BAO_ActionSchedule',
376 'name' => 'limit_to',
377 'type' => CRM_Utils_Type
::T_BOOLEAN
,
378 'title' => ts('Limit To'),
379 'description' => ts('Is this the recipient criteria limited to OR in addition to?'),
380 'where' => 'civicrm_action_schedule.limit_to',
381 'table_name' => 'civicrm_action_schedule',
382 'entity' => 'ActionSchedule',
383 'bao' => 'CRM_Core_BAO_ActionSchedule',
387 'name' => 'entity_value',
388 'type' => CRM_Utils_Type
::T_STRING
,
389 'title' => ts('Entity Value'),
390 'description' => ts('Entity value'),
392 'size' => CRM_Utils_Type
::HUGE
,
393 'where' => 'civicrm_action_schedule.entity_value',
394 'table_name' => 'civicrm_action_schedule',
395 'entity' => 'ActionSchedule',
396 'bao' => 'CRM_Core_BAO_ActionSchedule',
400 'name' => 'entity_status',
401 'type' => CRM_Utils_Type
::T_STRING
,
402 'title' => ts('Entity Status'),
403 'description' => ts('Entity status'),
405 'size' => CRM_Utils_Type
::BIG
,
406 'where' => 'civicrm_action_schedule.entity_status',
407 'table_name' => 'civicrm_action_schedule',
408 'entity' => 'ActionSchedule',
409 'bao' => 'CRM_Core_BAO_ActionSchedule',
412 'start_action_offset' => [
413 'name' => 'start_action_offset',
414 'type' => CRM_Utils_Type
::T_INT
,
415 'title' => ts('Start Action Offset'),
416 'description' => ts('Reminder Interval.'),
417 'where' => 'civicrm_action_schedule.start_action_offset',
419 'table_name' => 'civicrm_action_schedule',
420 'entity' => 'ActionSchedule',
421 'bao' => 'CRM_Core_BAO_ActionSchedule',
424 'start_action_unit' => [
425 'name' => 'start_action_unit',
426 'type' => CRM_Utils_Type
::T_STRING
,
427 'title' => ts('Start Action Unit'),
428 'description' => ts('Time units for reminder.'),
430 'size' => CRM_Utils_Type
::EIGHT
,
431 'where' => 'civicrm_action_schedule.start_action_unit',
432 'table_name' => 'civicrm_action_schedule',
433 'entity' => 'ActionSchedule',
434 'bao' => 'CRM_Core_BAO_ActionSchedule',
439 'pseudoconstant' => [
440 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
443 'start_action_condition' => [
444 'name' => 'start_action_condition',
445 'type' => CRM_Utils_Type
::T_STRING
,
446 'title' => ts('Start Action Condition'),
447 'description' => ts('Reminder Action'),
449 'size' => CRM_Utils_Type
::BIG
,
450 'where' => 'civicrm_action_schedule.start_action_condition',
451 'table_name' => 'civicrm_action_schedule',
452 'entity' => 'ActionSchedule',
453 'bao' => 'CRM_Core_BAO_ActionSchedule',
456 'start_action_date' => [
457 'name' => 'start_action_date',
458 'type' => CRM_Utils_Type
::T_STRING
,
459 'title' => ts('Start Action Date'),
460 'description' => ts('Entity date'),
462 'size' => CRM_Utils_Type
::BIG
,
463 'where' => 'civicrm_action_schedule.start_action_date',
464 'table_name' => 'civicrm_action_schedule',
465 'entity' => 'ActionSchedule',
466 'bao' => 'CRM_Core_BAO_ActionSchedule',
470 'name' => 'is_repeat',
471 'type' => CRM_Utils_Type
::T_BOOLEAN
,
472 'title' => ts('Repeat?'),
473 'where' => 'civicrm_action_schedule.is_repeat',
475 'table_name' => 'civicrm_action_schedule',
476 'entity' => 'ActionSchedule',
477 'bao' => 'CRM_Core_BAO_ActionSchedule',
480 'repetition_frequency_unit' => [
481 'name' => 'repetition_frequency_unit',
482 'type' => CRM_Utils_Type
::T_STRING
,
483 'title' => ts('Repetition Frequency Unit'),
484 'description' => ts('Time units for repetition of reminder.'),
486 'size' => CRM_Utils_Type
::EIGHT
,
487 'where' => 'civicrm_action_schedule.repetition_frequency_unit',
488 'table_name' => 'civicrm_action_schedule',
489 'entity' => 'ActionSchedule',
490 'bao' => 'CRM_Core_BAO_ActionSchedule',
495 'pseudoconstant' => [
496 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
499 'repetition_frequency_interval' => [
500 'name' => 'repetition_frequency_interval',
501 'type' => CRM_Utils_Type
::T_INT
,
502 'title' => ts('Repetition Frequency Interval'),
503 'description' => ts('Time interval for repeating the reminder.'),
504 'where' => 'civicrm_action_schedule.repetition_frequency_interval',
506 'table_name' => 'civicrm_action_schedule',
507 'entity' => 'ActionSchedule',
508 'bao' => 'CRM_Core_BAO_ActionSchedule',
511 'end_frequency_unit' => [
512 'name' => 'end_frequency_unit',
513 'type' => CRM_Utils_Type
::T_STRING
,
514 'title' => ts('End Frequency Unit'),
515 'description' => ts('Time units till repetition of reminder.'),
517 'size' => CRM_Utils_Type
::EIGHT
,
518 'where' => 'civicrm_action_schedule.end_frequency_unit',
519 'table_name' => 'civicrm_action_schedule',
520 'entity' => 'ActionSchedule',
521 'bao' => 'CRM_Core_BAO_ActionSchedule',
526 'pseudoconstant' => [
527 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
530 'end_frequency_interval' => [
531 'name' => 'end_frequency_interval',
532 'type' => CRM_Utils_Type
::T_INT
,
533 'title' => ts('End Frequency Interval'),
534 'description' => ts('Time interval till repeating the reminder.'),
535 'where' => 'civicrm_action_schedule.end_frequency_interval',
537 'table_name' => 'civicrm_action_schedule',
538 'entity' => 'ActionSchedule',
539 'bao' => 'CRM_Core_BAO_ActionSchedule',
543 'name' => 'end_action',
544 'type' => CRM_Utils_Type
::T_STRING
,
545 'title' => ts('End Action'),
546 'description' => ts('Reminder Action till repeating the reminder.'),
548 'size' => CRM_Utils_Type
::MEDIUM
,
549 'where' => 'civicrm_action_schedule.end_action',
550 'table_name' => 'civicrm_action_schedule',
551 'entity' => 'ActionSchedule',
552 'bao' => 'CRM_Core_BAO_ActionSchedule',
556 'name' => 'end_date',
557 'type' => CRM_Utils_Type
::T_STRING
,
558 'title' => ts('End Date'),
559 'description' => ts('Entity end date'),
561 'size' => CRM_Utils_Type
::BIG
,
562 'where' => 'civicrm_action_schedule.end_date',
563 'table_name' => 'civicrm_action_schedule',
564 'entity' => 'ActionSchedule',
565 'bao' => 'CRM_Core_BAO_ActionSchedule',
569 'name' => 'is_active',
570 'type' => CRM_Utils_Type
::T_BOOLEAN
,
571 'title' => ts('Schedule is Active?'),
572 'description' => ts('Is this option active?'),
573 'where' => 'civicrm_action_schedule.is_active',
575 'table_name' => 'civicrm_action_schedule',
576 'entity' => 'ActionSchedule',
577 'bao' => 'CRM_Core_BAO_ActionSchedule',
580 'recipient_manual' => [
581 'name' => 'recipient_manual',
582 'type' => CRM_Utils_Type
::T_STRING
,
583 'title' => ts('Recipient Manual'),
584 'description' => ts('Contact IDs to which reminder should be sent.'),
586 'size' => CRM_Utils_Type
::HUGE
,
587 'where' => 'civicrm_action_schedule.recipient_manual',
588 'table_name' => 'civicrm_action_schedule',
589 'entity' => 'ActionSchedule',
590 'bao' => 'CRM_Core_BAO_ActionSchedule',
593 'recipient_listing' => [
594 'name' => 'recipient_listing',
595 'type' => CRM_Utils_Type
::T_STRING
,
596 'title' => ts('Recipient Listing'),
597 'description' => ts('listing based on recipient field.'),
599 'size' => CRM_Utils_Type
::HUGE
,
600 'where' => 'civicrm_action_schedule.recipient_listing',
601 'table_name' => 'civicrm_action_schedule',
602 'entity' => 'ActionSchedule',
603 'bao' => 'CRM_Core_BAO_ActionSchedule',
607 'name' => 'body_text',
608 'type' => CRM_Utils_Type
::T_LONGTEXT
,
609 'title' => ts('Reminder Text'),
610 'description' => ts('Body of the mailing in text format.'),
611 'where' => 'civicrm_action_schedule.body_text',
612 'table_name' => 'civicrm_action_schedule',
613 'entity' => 'ActionSchedule',
614 'bao' => 'CRM_Core_BAO_ActionSchedule',
618 'name' => 'body_html',
619 'type' => CRM_Utils_Type
::T_LONGTEXT
,
620 'title' => ts('Reminder HTML'),
621 'description' => ts('Body of the mailing in html format.'),
622 'where' => 'civicrm_action_schedule.body_html',
623 'table_name' => 'civicrm_action_schedule',
624 'entity' => 'ActionSchedule',
625 'bao' => 'CRM_Core_BAO_ActionSchedule',
629 'name' => 'sms_body_text',
630 'type' => CRM_Utils_Type
::T_LONGTEXT
,
631 'title' => ts('SMS Reminder Text'),
632 'description' => ts('Content of the SMS text.'),
633 'where' => 'civicrm_action_schedule.sms_body_text',
634 'table_name' => 'civicrm_action_schedule',
635 'entity' => 'ActionSchedule',
636 'bao' => 'CRM_Core_BAO_ActionSchedule',
641 'type' => CRM_Utils_Type
::T_STRING
,
642 'title' => ts('Reminder Subject'),
643 'description' => ts('Subject of mailing'),
645 'size' => CRM_Utils_Type
::HUGE
,
646 'where' => 'civicrm_action_schedule.subject',
647 'table_name' => 'civicrm_action_schedule',
648 'entity' => 'ActionSchedule',
649 'bao' => 'CRM_Core_BAO_ActionSchedule',
652 'record_activity' => [
653 'name' => 'record_activity',
654 'type' => CRM_Utils_Type
::T_BOOLEAN
,
655 'title' => ts('Record Activity for Reminder?'),
656 'description' => ts('Record Activity for this reminder?'),
657 'where' => 'civicrm_action_schedule.record_activity',
659 'table_name' => 'civicrm_action_schedule',
660 'entity' => 'ActionSchedule',
661 'bao' => 'CRM_Core_BAO_ActionSchedule',
665 'name' => 'mapping_id',
666 'type' => CRM_Utils_Type
::T_STRING
,
667 'title' => ts('Reminder Mapping'),
668 'description' => ts('Name/ID of the mapping to use on this table'),
670 'size' => CRM_Utils_Type
::BIG
,
671 'where' => 'civicrm_action_schedule.mapping_id',
672 'table_name' => 'civicrm_action_schedule',
673 'entity' => 'ActionSchedule',
674 'bao' => 'CRM_Core_BAO_ActionSchedule',
678 'name' => 'group_id',
679 'type' => CRM_Utils_Type
::T_INT
,
680 'title' => ts('Reminder Group'),
681 'description' => ts('FK to Group'),
682 'where' => 'civicrm_action_schedule.group_id',
683 'table_name' => 'civicrm_action_schedule',
684 'entity' => 'ActionSchedule',
685 'bao' => 'CRM_Core_BAO_ActionSchedule',
687 'FKClassName' => 'CRM_Contact_DAO_Group',
691 'pseudoconstant' => [
692 'table' => 'civicrm_group',
694 'labelColumn' => 'title',
697 'msg_template_id' => [
698 'name' => 'msg_template_id',
699 'type' => CRM_Utils_Type
::T_INT
,
700 'title' => ts('Reminder Template'),
701 'description' => ts('FK to the message template.'),
702 'where' => 'civicrm_action_schedule.msg_template_id',
703 'table_name' => 'civicrm_action_schedule',
704 'entity' => 'ActionSchedule',
705 'bao' => 'CRM_Core_BAO_ActionSchedule',
707 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
709 'sms_template_id' => [
710 'name' => 'sms_template_id',
711 'type' => CRM_Utils_Type
::T_INT
,
712 'title' => ts('SMS Reminder Template'),
713 'description' => ts('FK to the message template.'),
714 'where' => 'civicrm_action_schedule.sms_template_id',
715 'table_name' => 'civicrm_action_schedule',
716 'entity' => 'ActionSchedule',
717 'bao' => 'CRM_Core_BAO_ActionSchedule',
719 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
722 'name' => 'absolute_date',
723 'type' => CRM_Utils_Type
::T_DATE
,
724 'title' => ts('Fixed Date for Reminder'),
725 'description' => ts('Date on which the reminder be sent.'),
726 'where' => 'civicrm_action_schedule.absolute_date',
727 'table_name' => 'civicrm_action_schedule',
728 'entity' => 'ActionSchedule',
729 'bao' => 'CRM_Core_BAO_ActionSchedule',
733 'name' => 'from_name',
734 'type' => CRM_Utils_Type
::T_STRING
,
735 'title' => ts('Reminder from Name'),
736 'description' => ts('Name in "from" field'),
738 'size' => CRM_Utils_Type
::HUGE
,
739 'where' => 'civicrm_action_schedule.from_name',
740 'table_name' => 'civicrm_action_schedule',
741 'entity' => 'ActionSchedule',
742 'bao' => 'CRM_Core_BAO_ActionSchedule',
746 'name' => 'from_email',
747 'type' => CRM_Utils_Type
::T_STRING
,
748 'title' => ts('Reminder From Email'),
749 'description' => ts('Email address in "from" field'),
751 'size' => CRM_Utils_Type
::HUGE
,
752 'where' => 'civicrm_action_schedule.from_email',
753 'table_name' => 'civicrm_action_schedule',
754 'entity' => 'ActionSchedule',
755 'bao' => 'CRM_Core_BAO_ActionSchedule',
760 'type' => CRM_Utils_Type
::T_STRING
,
761 'title' => ts('Message Mode'),
762 'description' => ts('Send the message as email or sms or both.'),
764 'size' => CRM_Utils_Type
::HUGE
,
765 'where' => 'civicrm_action_schedule.mode',
766 'default' => 'Email',
767 'table_name' => 'civicrm_action_schedule',
768 'entity' => 'ActionSchedule',
769 'bao' => 'CRM_Core_BAO_ActionSchedule',
774 'pseudoconstant' => [
775 'optionGroupName' => 'msg_mode',
776 'optionEditPath' => 'civicrm/admin/options/msg_mode',
779 'sms_provider_id' => [
780 'name' => 'sms_provider_id',
781 'type' => CRM_Utils_Type
::T_INT
,
782 'title' => ts('SMS Provider'),
783 'where' => 'civicrm_action_schedule.sms_provider_id',
784 'table_name' => 'civicrm_action_schedule',
785 'entity' => 'ActionSchedule',
786 'bao' => 'CRM_Core_BAO_ActionSchedule',
788 'FKClassName' => 'CRM_SMS_DAO_Provider',
794 'name' => 'used_for',
795 'type' => CRM_Utils_Type
::T_STRING
,
796 'title' => ts('Used For'),
797 'description' => ts('Used for repeating entity'),
799 'size' => CRM_Utils_Type
::BIG
,
800 'where' => 'civicrm_action_schedule.used_for',
801 'table_name' => 'civicrm_action_schedule',
802 'entity' => 'ActionSchedule',
803 'bao' => 'CRM_Core_BAO_ActionSchedule',
806 'filter_contact_language' => [
807 'name' => 'filter_contact_language',
808 'type' => CRM_Utils_Type
::T_STRING
,
809 'title' => ts('Filter Contact Language'),
810 'description' => ts('Used for multilingual installation'),
812 'size' => CRM_Utils_Type
::HUGE
,
813 'where' => 'civicrm_action_schedule.filter_contact_language',
814 'table_name' => 'civicrm_action_schedule',
815 'entity' => 'ActionSchedule',
816 'bao' => 'CRM_Core_BAO_ActionSchedule',
819 'communication_language' => [
820 'name' => 'communication_language',
821 'type' => CRM_Utils_Type
::T_STRING
,
822 'title' => ts('Communication Language'),
823 'description' => ts('Used for multilingual installation'),
825 'size' => CRM_Utils_Type
::EIGHT
,
826 'where' => 'civicrm_action_schedule.communication_language',
827 'table_name' => 'civicrm_action_schedule',
828 'entity' => 'ActionSchedule',
829 'bao' => 'CRM_Core_BAO_ActionSchedule',
833 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
835 return Civi
::$statics[__CLASS__
]['fields'];
839 * Return a mapping from field-name to the corresponding key (as used in fields()).
842 * Array(string $name => string $uniqueName).
844 public static function &fieldKeys() {
845 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
846 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
848 return Civi
::$statics[__CLASS__
]['fieldKeys'];
852 * Returns the names of this table
856 public static function getTableName() {
857 return self
::$_tableName;
861 * Returns if this table needs to be logged
865 public function getLog() {
870 * Returns the list of fields that can be imported
872 * @param bool $prefix
876 public static function &import($prefix = FALSE) {
877 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'action_schedule', $prefix, []);
882 * Returns the list of fields that can be exported
884 * @param bool $prefix
888 public static function &export($prefix = FALSE) {
889 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'action_schedule', $prefix, []);
894 * Returns the list of indices
896 * @param bool $localize
900 public static function indices($localize = TRUE) {
902 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;