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:4d6dca3786a9d3ab90b492be017b045b)
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 static $_tableName = 'civicrm_action_schedule';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_action_schedule',
331 'entity' => 'ActionSchedule',
332 'bao' => 'CRM_Core_BAO_ActionSchedule',
337 'type' => CRM_Utils_Type
::T_STRING
,
338 'title' => ts('Name'),
339 'description' => ts('Name of the action(reminder)'),
341 'size' => CRM_Utils_Type
::BIG
,
342 'table_name' => 'civicrm_action_schedule',
343 'entity' => 'ActionSchedule',
344 'bao' => 'CRM_Core_BAO_ActionSchedule',
349 'type' => CRM_Utils_Type
::T_STRING
,
350 'title' => ts('Title'),
351 'description' => ts('Title of the action(reminder)'),
353 'size' => CRM_Utils_Type
::BIG
,
354 'table_name' => 'civicrm_action_schedule',
355 'entity' => 'ActionSchedule',
356 'bao' => 'CRM_Core_BAO_ActionSchedule',
360 'name' => 'recipient',
361 'type' => CRM_Utils_Type
::T_STRING
,
362 'title' => ts('Recipient'),
363 'description' => ts('Recipient'),
365 'size' => CRM_Utils_Type
::BIG
,
366 'table_name' => 'civicrm_action_schedule',
367 'entity' => 'ActionSchedule',
368 'bao' => 'CRM_Core_BAO_ActionSchedule',
372 'name' => 'limit_to',
373 'type' => CRM_Utils_Type
::T_BOOLEAN
,
374 'title' => ts('Limit To'),
375 'description' => ts('Is this the recipient criteria limited to OR in addition to?'),
376 'table_name' => 'civicrm_action_schedule',
377 'entity' => 'ActionSchedule',
378 'bao' => 'CRM_Core_BAO_ActionSchedule',
382 'name' => 'entity_value',
383 'type' => CRM_Utils_Type
::T_STRING
,
384 'title' => ts('Entity Value'),
385 'description' => ts('Entity value'),
387 'size' => CRM_Utils_Type
::HUGE
,
388 'table_name' => 'civicrm_action_schedule',
389 'entity' => 'ActionSchedule',
390 'bao' => 'CRM_Core_BAO_ActionSchedule',
394 'name' => 'entity_status',
395 'type' => CRM_Utils_Type
::T_STRING
,
396 'title' => ts('Entity Status'),
397 'description' => ts('Entity status'),
399 'size' => CRM_Utils_Type
::BIG
,
400 'table_name' => 'civicrm_action_schedule',
401 'entity' => 'ActionSchedule',
402 'bao' => 'CRM_Core_BAO_ActionSchedule',
405 'start_action_offset' => [
406 'name' => 'start_action_offset',
407 'type' => CRM_Utils_Type
::T_INT
,
408 'title' => ts('Start Action Offset'),
409 'description' => ts('Reminder Interval.'),
411 'table_name' => 'civicrm_action_schedule',
412 'entity' => 'ActionSchedule',
413 'bao' => 'CRM_Core_BAO_ActionSchedule',
416 'start_action_unit' => [
417 'name' => 'start_action_unit',
418 'type' => CRM_Utils_Type
::T_STRING
,
419 'title' => ts('Start Action Unit'),
420 'description' => ts('Time units for reminder.'),
422 'size' => CRM_Utils_Type
::EIGHT
,
423 'table_name' => 'civicrm_action_schedule',
424 'entity' => 'ActionSchedule',
425 'bao' => 'CRM_Core_BAO_ActionSchedule',
430 'pseudoconstant' => [
431 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
434 'start_action_condition' => [
435 'name' => 'start_action_condition',
436 'type' => CRM_Utils_Type
::T_STRING
,
437 'title' => ts('Start Action Condition'),
438 'description' => ts('Reminder Action'),
440 'size' => CRM_Utils_Type
::BIG
,
441 'table_name' => 'civicrm_action_schedule',
442 'entity' => 'ActionSchedule',
443 'bao' => 'CRM_Core_BAO_ActionSchedule',
446 'start_action_date' => [
447 'name' => 'start_action_date',
448 'type' => CRM_Utils_Type
::T_STRING
,
449 'title' => ts('Start Action Date'),
450 'description' => ts('Entity date'),
452 'size' => CRM_Utils_Type
::BIG
,
453 'table_name' => 'civicrm_action_schedule',
454 'entity' => 'ActionSchedule',
455 'bao' => 'CRM_Core_BAO_ActionSchedule',
459 'name' => 'is_repeat',
460 'type' => CRM_Utils_Type
::T_BOOLEAN
,
461 'title' => ts('Repeat?'),
463 'table_name' => 'civicrm_action_schedule',
464 'entity' => 'ActionSchedule',
465 'bao' => 'CRM_Core_BAO_ActionSchedule',
468 'repetition_frequency_unit' => [
469 'name' => 'repetition_frequency_unit',
470 'type' => CRM_Utils_Type
::T_STRING
,
471 'title' => ts('Repetition Frequency Unit'),
472 'description' => ts('Time units for repetition of reminder.'),
474 'size' => CRM_Utils_Type
::EIGHT
,
475 'table_name' => 'civicrm_action_schedule',
476 'entity' => 'ActionSchedule',
477 'bao' => 'CRM_Core_BAO_ActionSchedule',
482 'pseudoconstant' => [
483 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
486 'repetition_frequency_interval' => [
487 'name' => 'repetition_frequency_interval',
488 'type' => CRM_Utils_Type
::T_INT
,
489 'title' => ts('Repetition Frequency Interval'),
490 'description' => ts('Time interval for repeating the reminder.'),
492 'table_name' => 'civicrm_action_schedule',
493 'entity' => 'ActionSchedule',
494 'bao' => 'CRM_Core_BAO_ActionSchedule',
497 'end_frequency_unit' => [
498 'name' => 'end_frequency_unit',
499 'type' => CRM_Utils_Type
::T_STRING
,
500 'title' => ts('End Frequency Unit'),
501 'description' => ts('Time units till repetition of reminder.'),
503 'size' => CRM_Utils_Type
::EIGHT
,
504 'table_name' => 'civicrm_action_schedule',
505 'entity' => 'ActionSchedule',
506 'bao' => 'CRM_Core_BAO_ActionSchedule',
511 'pseudoconstant' => [
512 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
515 'end_frequency_interval' => [
516 'name' => 'end_frequency_interval',
517 'type' => CRM_Utils_Type
::T_INT
,
518 'title' => ts('End Frequency Interval'),
519 'description' => ts('Time interval till repeating the reminder.'),
521 'table_name' => 'civicrm_action_schedule',
522 'entity' => 'ActionSchedule',
523 'bao' => 'CRM_Core_BAO_ActionSchedule',
527 'name' => 'end_action',
528 'type' => CRM_Utils_Type
::T_STRING
,
529 'title' => ts('End Action'),
530 'description' => ts('Reminder Action till repeating the reminder.'),
532 'size' => CRM_Utils_Type
::MEDIUM
,
533 'table_name' => 'civicrm_action_schedule',
534 'entity' => 'ActionSchedule',
535 'bao' => 'CRM_Core_BAO_ActionSchedule',
539 'name' => 'end_date',
540 'type' => CRM_Utils_Type
::T_STRING
,
541 'title' => ts('End Date'),
542 'description' => ts('Entity end date'),
544 'size' => CRM_Utils_Type
::BIG
,
545 'table_name' => 'civicrm_action_schedule',
546 'entity' => 'ActionSchedule',
547 'bao' => 'CRM_Core_BAO_ActionSchedule',
551 'name' => 'is_active',
552 'type' => CRM_Utils_Type
::T_BOOLEAN
,
553 'title' => ts('Schedule is Active?'),
554 'description' => ts('Is this option active?'),
556 'table_name' => 'civicrm_action_schedule',
557 'entity' => 'ActionSchedule',
558 'bao' => 'CRM_Core_BAO_ActionSchedule',
561 'recipient_manual' => [
562 'name' => 'recipient_manual',
563 'type' => CRM_Utils_Type
::T_STRING
,
564 'title' => ts('Recipient Manual'),
565 'description' => ts('Contact IDs to which reminder should be sent.'),
567 'size' => CRM_Utils_Type
::HUGE
,
568 'table_name' => 'civicrm_action_schedule',
569 'entity' => 'ActionSchedule',
570 'bao' => 'CRM_Core_BAO_ActionSchedule',
573 'recipient_listing' => [
574 'name' => 'recipient_listing',
575 'type' => CRM_Utils_Type
::T_STRING
,
576 'title' => ts('Recipient Listing'),
577 'description' => ts('listing based on recipient field.'),
579 'size' => CRM_Utils_Type
::HUGE
,
580 'table_name' => 'civicrm_action_schedule',
581 'entity' => 'ActionSchedule',
582 'bao' => 'CRM_Core_BAO_ActionSchedule',
586 'name' => 'body_text',
587 'type' => CRM_Utils_Type
::T_LONGTEXT
,
588 'title' => ts('Reminder Text'),
589 'description' => ts('Body of the mailing in text format.'),
590 'table_name' => 'civicrm_action_schedule',
591 'entity' => 'ActionSchedule',
592 'bao' => 'CRM_Core_BAO_ActionSchedule',
596 'name' => 'body_html',
597 'type' => CRM_Utils_Type
::T_LONGTEXT
,
598 'title' => ts('Reminder HTML'),
599 'description' => ts('Body of the mailing in html format.'),
600 'table_name' => 'civicrm_action_schedule',
601 'entity' => 'ActionSchedule',
602 'bao' => 'CRM_Core_BAO_ActionSchedule',
606 'name' => 'sms_body_text',
607 'type' => CRM_Utils_Type
::T_LONGTEXT
,
608 'title' => ts('SMS Reminder Text'),
609 'description' => ts('Content of the SMS text.'),
610 'table_name' => 'civicrm_action_schedule',
611 'entity' => 'ActionSchedule',
612 'bao' => 'CRM_Core_BAO_ActionSchedule',
617 'type' => CRM_Utils_Type
::T_STRING
,
618 'title' => ts('Reminder Subject'),
619 'description' => ts('Subject of mailing'),
621 'size' => CRM_Utils_Type
::HUGE
,
622 'table_name' => 'civicrm_action_schedule',
623 'entity' => 'ActionSchedule',
624 'bao' => 'CRM_Core_BAO_ActionSchedule',
627 'record_activity' => [
628 'name' => 'record_activity',
629 'type' => CRM_Utils_Type
::T_BOOLEAN
,
630 'title' => ts('Record Activity for Reminder?'),
631 'description' => ts('Record Activity for this reminder?'),
633 'table_name' => 'civicrm_action_schedule',
634 'entity' => 'ActionSchedule',
635 'bao' => 'CRM_Core_BAO_ActionSchedule',
639 'name' => 'mapping_id',
640 'type' => CRM_Utils_Type
::T_STRING
,
641 'title' => ts('Reminder Mapping'),
642 'description' => ts('Name/ID of the mapping to use on this table'),
644 'size' => CRM_Utils_Type
::BIG
,
645 'table_name' => 'civicrm_action_schedule',
646 'entity' => 'ActionSchedule',
647 'bao' => 'CRM_Core_BAO_ActionSchedule',
651 'name' => 'group_id',
652 'type' => CRM_Utils_Type
::T_INT
,
653 'title' => ts('Reminder Group'),
654 'description' => ts('FK to Group'),
655 'table_name' => 'civicrm_action_schedule',
656 'entity' => 'ActionSchedule',
657 'bao' => 'CRM_Core_BAO_ActionSchedule',
659 'FKClassName' => 'CRM_Contact_DAO_Group',
663 'pseudoconstant' => [
664 'table' => 'civicrm_group',
666 'labelColumn' => 'title',
669 'msg_template_id' => [
670 'name' => 'msg_template_id',
671 'type' => CRM_Utils_Type
::T_INT
,
672 'title' => ts('Reminder Template'),
673 'description' => ts('FK to the message template.'),
674 'table_name' => 'civicrm_action_schedule',
675 'entity' => 'ActionSchedule',
676 'bao' => 'CRM_Core_BAO_ActionSchedule',
678 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
680 'sms_template_id' => [
681 'name' => 'sms_template_id',
682 'type' => CRM_Utils_Type
::T_INT
,
683 'title' => ts('SMS Reminder Template'),
684 'description' => ts('FK to the message template.'),
685 'table_name' => 'civicrm_action_schedule',
686 'entity' => 'ActionSchedule',
687 'bao' => 'CRM_Core_BAO_ActionSchedule',
689 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
692 'name' => 'absolute_date',
693 'type' => CRM_Utils_Type
::T_DATE
,
694 'title' => ts('Fixed Date for Reminder'),
695 'description' => ts('Date on which the reminder be sent.'),
696 'table_name' => 'civicrm_action_schedule',
697 'entity' => 'ActionSchedule',
698 'bao' => 'CRM_Core_BAO_ActionSchedule',
702 'name' => 'from_name',
703 'type' => CRM_Utils_Type
::T_STRING
,
704 'title' => ts('Reminder from Name'),
705 'description' => ts('Name in "from" field'),
707 'size' => CRM_Utils_Type
::HUGE
,
708 'table_name' => 'civicrm_action_schedule',
709 'entity' => 'ActionSchedule',
710 'bao' => 'CRM_Core_BAO_ActionSchedule',
714 'name' => 'from_email',
715 'type' => CRM_Utils_Type
::T_STRING
,
716 'title' => ts('Reminder From Email'),
717 'description' => ts('Email address in "from" field'),
719 'size' => CRM_Utils_Type
::HUGE
,
720 'table_name' => 'civicrm_action_schedule',
721 'entity' => 'ActionSchedule',
722 'bao' => 'CRM_Core_BAO_ActionSchedule',
727 'type' => CRM_Utils_Type
::T_STRING
,
728 'title' => ts('Message Mode'),
729 'description' => ts('Send the message as email or sms or both.'),
731 'size' => CRM_Utils_Type
::HUGE
,
732 'default' => 'Email',
733 'table_name' => 'civicrm_action_schedule',
734 'entity' => 'ActionSchedule',
735 'bao' => 'CRM_Core_BAO_ActionSchedule',
740 'pseudoconstant' => [
741 'optionGroupName' => 'msg_mode',
742 'optionEditPath' => 'civicrm/admin/options/msg_mode',
745 'sms_provider_id' => [
746 'name' => 'sms_provider_id',
747 'type' => CRM_Utils_Type
::T_INT
,
748 'title' => ts('SMS Provider'),
749 'table_name' => 'civicrm_action_schedule',
750 'entity' => 'ActionSchedule',
751 'bao' => 'CRM_Core_BAO_ActionSchedule',
753 'FKClassName' => 'CRM_SMS_DAO_Provider',
759 'name' => 'used_for',
760 'type' => CRM_Utils_Type
::T_STRING
,
761 'title' => ts('Used For'),
762 'description' => ts('Used for repeating entity'),
764 'size' => CRM_Utils_Type
::BIG
,
765 'table_name' => 'civicrm_action_schedule',
766 'entity' => 'ActionSchedule',
767 'bao' => 'CRM_Core_BAO_ActionSchedule',
770 'filter_contact_language' => [
771 'name' => 'filter_contact_language',
772 'type' => CRM_Utils_Type
::T_STRING
,
773 'title' => ts('Filter Contact Language'),
774 'description' => ts('Used for multilingual installation'),
776 'size' => CRM_Utils_Type
::HUGE
,
777 'table_name' => 'civicrm_action_schedule',
778 'entity' => 'ActionSchedule',
779 'bao' => 'CRM_Core_BAO_ActionSchedule',
782 'communication_language' => [
783 'name' => 'communication_language',
784 'type' => CRM_Utils_Type
::T_STRING
,
785 'title' => ts('Communication Language'),
786 'description' => ts('Used for multilingual installation'),
788 'size' => CRM_Utils_Type
::EIGHT
,
789 'table_name' => 'civicrm_action_schedule',
790 'entity' => 'ActionSchedule',
791 'bao' => 'CRM_Core_BAO_ActionSchedule',
795 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
797 return Civi
::$statics[__CLASS__
]['fields'];
801 * Return a mapping from field-name to the corresponding key (as used in fields()).
804 * Array(string $name => string $uniqueName).
806 public static function &fieldKeys() {
807 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
808 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
810 return Civi
::$statics[__CLASS__
]['fieldKeys'];
814 * Returns the names of this table
818 public static function getTableName() {
819 return self
::$_tableName;
823 * Returns if this table needs to be logged
827 public function getLog() {
832 * Returns the list of fields that can be imported
834 * @param bool $prefix
838 public static function &import($prefix = FALSE) {
839 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'action_schedule', $prefix, []);
844 * Returns the list of fields that can be exported
846 * @param bool $prefix
850 public static function &export($prefix = FALSE) {
851 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'action_schedule', $prefix, []);
856 * Returns the list of indices
858 * @param bool $localize
862 public static function indices($localize = TRUE) {
864 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;