5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Core/ActionSchedule.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:d158b2da297ca83e4210a3fa0da8d5eb)
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' => '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' => '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' => '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' => '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' => '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' => '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' => 'Reminder Interval.',
410 'table_name' => 'civicrm_action_schedule',
411 'entity' => 'ActionSchedule',
412 'bao' => 'CRM_Core_BAO_ActionSchedule',
415 'start_action_unit' => [
416 'name' => 'start_action_unit',
417 'type' => CRM_Utils_Type
::T_STRING
,
418 'title' => ts('Start Action Unit'),
419 'description' => 'Time units for reminder.',
421 'size' => CRM_Utils_Type
::EIGHT
,
422 'table_name' => 'civicrm_action_schedule',
423 'entity' => 'ActionSchedule',
424 'bao' => 'CRM_Core_BAO_ActionSchedule',
429 'pseudoconstant' => [
430 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
433 'start_action_condition' => [
434 'name' => 'start_action_condition',
435 'type' => CRM_Utils_Type
::T_STRING
,
436 'title' => ts('Start Action Condition'),
437 'description' => 'Reminder Action',
439 'size' => CRM_Utils_Type
::BIG
,
440 'table_name' => 'civicrm_action_schedule',
441 'entity' => 'ActionSchedule',
442 'bao' => 'CRM_Core_BAO_ActionSchedule',
445 'start_action_date' => [
446 'name' => 'start_action_date',
447 'type' => CRM_Utils_Type
::T_STRING
,
448 'title' => ts('Start Action Date'),
449 'description' => 'Entity date',
451 'size' => CRM_Utils_Type
::BIG
,
452 'table_name' => 'civicrm_action_schedule',
453 'entity' => 'ActionSchedule',
454 'bao' => 'CRM_Core_BAO_ActionSchedule',
458 'name' => 'is_repeat',
459 'type' => CRM_Utils_Type
::T_BOOLEAN
,
460 'title' => ts('Repeat?'),
461 'table_name' => 'civicrm_action_schedule',
462 'entity' => 'ActionSchedule',
463 'bao' => 'CRM_Core_BAO_ActionSchedule',
466 'repetition_frequency_unit' => [
467 'name' => 'repetition_frequency_unit',
468 'type' => CRM_Utils_Type
::T_STRING
,
469 'title' => ts('Repetition Frequency Unit'),
470 'description' => 'Time units for repetition of reminder.',
472 'size' => CRM_Utils_Type
::EIGHT
,
473 'table_name' => 'civicrm_action_schedule',
474 'entity' => 'ActionSchedule',
475 'bao' => 'CRM_Core_BAO_ActionSchedule',
480 'pseudoconstant' => [
481 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
484 'repetition_frequency_interval' => [
485 'name' => 'repetition_frequency_interval',
486 'type' => CRM_Utils_Type
::T_INT
,
487 'title' => ts('Repetition Frequency Interval'),
488 'description' => 'Time interval for repeating the reminder.',
489 'table_name' => 'civicrm_action_schedule',
490 'entity' => 'ActionSchedule',
491 'bao' => 'CRM_Core_BAO_ActionSchedule',
494 'end_frequency_unit' => [
495 'name' => 'end_frequency_unit',
496 'type' => CRM_Utils_Type
::T_STRING
,
497 'title' => ts('End Frequency Unit'),
498 'description' => 'Time units till repetition of reminder.',
500 'size' => CRM_Utils_Type
::EIGHT
,
501 'table_name' => 'civicrm_action_schedule',
502 'entity' => 'ActionSchedule',
503 'bao' => 'CRM_Core_BAO_ActionSchedule',
508 'pseudoconstant' => [
509 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
512 'end_frequency_interval' => [
513 'name' => 'end_frequency_interval',
514 'type' => CRM_Utils_Type
::T_INT
,
515 'title' => ts('End Frequency Interval'),
516 'description' => 'Time interval till repeating the reminder.',
517 'table_name' => 'civicrm_action_schedule',
518 'entity' => 'ActionSchedule',
519 'bao' => 'CRM_Core_BAO_ActionSchedule',
523 'name' => 'end_action',
524 'type' => CRM_Utils_Type
::T_STRING
,
525 'title' => ts('End Action'),
526 'description' => 'Reminder Action till repeating the reminder.',
528 'size' => CRM_Utils_Type
::MEDIUM
,
529 'table_name' => 'civicrm_action_schedule',
530 'entity' => 'ActionSchedule',
531 'bao' => 'CRM_Core_BAO_ActionSchedule',
535 'name' => 'end_date',
536 'type' => CRM_Utils_Type
::T_STRING
,
537 'title' => ts('End Date'),
538 'description' => 'Entity end date',
540 'size' => CRM_Utils_Type
::BIG
,
541 'table_name' => 'civicrm_action_schedule',
542 'entity' => 'ActionSchedule',
543 'bao' => 'CRM_Core_BAO_ActionSchedule',
547 'name' => 'is_active',
548 'type' => CRM_Utils_Type
::T_BOOLEAN
,
549 'title' => ts('Schedule is Active?'),
550 'description' => 'Is this option active?',
552 'table_name' => 'civicrm_action_schedule',
553 'entity' => 'ActionSchedule',
554 'bao' => 'CRM_Core_BAO_ActionSchedule',
557 'recipient_manual' => [
558 'name' => 'recipient_manual',
559 'type' => CRM_Utils_Type
::T_STRING
,
560 'title' => ts('Recipient Manual'),
561 'description' => 'Contact IDs to which reminder should be sent.',
563 'size' => CRM_Utils_Type
::HUGE
,
564 'table_name' => 'civicrm_action_schedule',
565 'entity' => 'ActionSchedule',
566 'bao' => 'CRM_Core_BAO_ActionSchedule',
569 'recipient_listing' => [
570 'name' => 'recipient_listing',
571 'type' => CRM_Utils_Type
::T_STRING
,
572 'title' => ts('Recipient Listing'),
573 'description' => 'listing based on recipient field.',
575 'size' => CRM_Utils_Type
::HUGE
,
576 'table_name' => 'civicrm_action_schedule',
577 'entity' => 'ActionSchedule',
578 'bao' => 'CRM_Core_BAO_ActionSchedule',
582 'name' => 'body_text',
583 'type' => CRM_Utils_Type
::T_LONGTEXT
,
584 'title' => ts('Reminder Text'),
585 'description' => 'Body of the mailing in text format.',
586 'table_name' => 'civicrm_action_schedule',
587 'entity' => 'ActionSchedule',
588 'bao' => 'CRM_Core_BAO_ActionSchedule',
592 'name' => 'body_html',
593 'type' => CRM_Utils_Type
::T_LONGTEXT
,
594 'title' => ts('Reminder HTML'),
595 'description' => 'Body of the mailing in html format.',
596 'table_name' => 'civicrm_action_schedule',
597 'entity' => 'ActionSchedule',
598 'bao' => 'CRM_Core_BAO_ActionSchedule',
602 'name' => 'sms_body_text',
603 'type' => CRM_Utils_Type
::T_LONGTEXT
,
604 'title' => ts('SMS Reminder Text'),
605 'description' => 'Content of the SMS text.',
606 'table_name' => 'civicrm_action_schedule',
607 'entity' => 'ActionSchedule',
608 'bao' => 'CRM_Core_BAO_ActionSchedule',
613 'type' => CRM_Utils_Type
::T_STRING
,
614 'title' => ts('Reminder Subject'),
615 'description' => 'Subject of mailing',
617 'size' => CRM_Utils_Type
::HUGE
,
618 'table_name' => 'civicrm_action_schedule',
619 'entity' => 'ActionSchedule',
620 'bao' => 'CRM_Core_BAO_ActionSchedule',
623 'record_activity' => [
624 'name' => 'record_activity',
625 'type' => CRM_Utils_Type
::T_BOOLEAN
,
626 'title' => ts('Record Activity for Reminder?'),
627 'description' => 'Record Activity for this reminder?',
629 'table_name' => 'civicrm_action_schedule',
630 'entity' => 'ActionSchedule',
631 'bao' => 'CRM_Core_BAO_ActionSchedule',
635 'name' => 'mapping_id',
636 'type' => CRM_Utils_Type
::T_STRING
,
637 'title' => ts('Reminder Mapping'),
638 'description' => 'Name/ID of the mapping to use on this table',
640 'size' => CRM_Utils_Type
::BIG
,
641 'table_name' => 'civicrm_action_schedule',
642 'entity' => 'ActionSchedule',
643 'bao' => 'CRM_Core_BAO_ActionSchedule',
647 'name' => 'group_id',
648 'type' => CRM_Utils_Type
::T_INT
,
649 'title' => ts('Reminder Group'),
650 'description' => 'FK to Group',
651 'table_name' => 'civicrm_action_schedule',
652 'entity' => 'ActionSchedule',
653 'bao' => 'CRM_Core_BAO_ActionSchedule',
655 'FKClassName' => 'CRM_Contact_DAO_Group',
659 'pseudoconstant' => [
660 'table' => 'civicrm_group',
662 'labelColumn' => 'title',
665 'msg_template_id' => [
666 'name' => 'msg_template_id',
667 'type' => CRM_Utils_Type
::T_INT
,
668 'title' => ts('Reminder Template'),
669 'description' => 'FK to the message template.',
670 'table_name' => 'civicrm_action_schedule',
671 'entity' => 'ActionSchedule',
672 'bao' => 'CRM_Core_BAO_ActionSchedule',
674 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
676 'sms_template_id' => [
677 'name' => 'sms_template_id',
678 'type' => CRM_Utils_Type
::T_INT
,
679 'title' => ts('SMS Reminder Template'),
680 'description' => 'FK to the message template.',
681 'table_name' => 'civicrm_action_schedule',
682 'entity' => 'ActionSchedule',
683 'bao' => 'CRM_Core_BAO_ActionSchedule',
685 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
688 'name' => 'absolute_date',
689 'type' => CRM_Utils_Type
::T_DATE
,
690 'title' => ts('Fixed Date for Reminder'),
691 'description' => 'Date on which the reminder be sent.',
692 'table_name' => 'civicrm_action_schedule',
693 'entity' => 'ActionSchedule',
694 'bao' => 'CRM_Core_BAO_ActionSchedule',
698 'name' => 'from_name',
699 'type' => CRM_Utils_Type
::T_STRING
,
700 'title' => ts('Reminder from Name'),
701 'description' => 'Name in "from" field',
703 'size' => CRM_Utils_Type
::HUGE
,
704 'table_name' => 'civicrm_action_schedule',
705 'entity' => 'ActionSchedule',
706 'bao' => 'CRM_Core_BAO_ActionSchedule',
710 'name' => 'from_email',
711 'type' => CRM_Utils_Type
::T_STRING
,
712 'title' => ts('Reminder From Email'),
713 'description' => 'Email address in "from" field',
715 'size' => CRM_Utils_Type
::HUGE
,
716 'table_name' => 'civicrm_action_schedule',
717 'entity' => 'ActionSchedule',
718 'bao' => 'CRM_Core_BAO_ActionSchedule',
723 'type' => CRM_Utils_Type
::T_STRING
,
724 'title' => ts('Message Mode'),
725 'description' => 'Send the message as email or sms or both.',
727 'size' => CRM_Utils_Type
::HUGE
,
728 'default' => 'Email',
729 'table_name' => 'civicrm_action_schedule',
730 'entity' => 'ActionSchedule',
731 'bao' => 'CRM_Core_BAO_ActionSchedule',
736 'pseudoconstant' => [
737 'optionGroupName' => 'msg_mode',
738 'optionEditPath' => 'civicrm/admin/options/msg_mode',
741 'sms_provider_id' => [
742 'name' => 'sms_provider_id',
743 'type' => CRM_Utils_Type
::T_INT
,
744 'title' => ts('SMS Provider'),
745 'table_name' => 'civicrm_action_schedule',
746 'entity' => 'ActionSchedule',
747 'bao' => 'CRM_Core_BAO_ActionSchedule',
749 'FKClassName' => 'CRM_SMS_DAO_Provider',
755 'name' => 'used_for',
756 'type' => CRM_Utils_Type
::T_STRING
,
757 'title' => ts('Used For'),
758 'description' => 'Used for repeating entity',
760 'size' => CRM_Utils_Type
::BIG
,
761 'table_name' => 'civicrm_action_schedule',
762 'entity' => 'ActionSchedule',
763 'bao' => 'CRM_Core_BAO_ActionSchedule',
766 'filter_contact_language' => [
767 'name' => 'filter_contact_language',
768 'type' => CRM_Utils_Type
::T_STRING
,
769 'title' => ts('Filter Contact Language'),
770 'description' => 'Used for multilingual installation',
772 'size' => CRM_Utils_Type
::HUGE
,
773 'table_name' => 'civicrm_action_schedule',
774 'entity' => 'ActionSchedule',
775 'bao' => 'CRM_Core_BAO_ActionSchedule',
778 'communication_language' => [
779 'name' => 'communication_language',
780 'type' => CRM_Utils_Type
::T_STRING
,
781 'title' => ts('Communication Language'),
782 'description' => 'Used for multilingual installation',
784 'size' => CRM_Utils_Type
::EIGHT
,
785 'table_name' => 'civicrm_action_schedule',
786 'entity' => 'ActionSchedule',
787 'bao' => 'CRM_Core_BAO_ActionSchedule',
791 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
793 return Civi
::$statics[__CLASS__
]['fields'];
797 * Return a mapping from field-name to the corresponding key (as used in fields()).
800 * Array(string $name => string $uniqueName).
802 public static function &fieldKeys() {
803 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
804 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
806 return Civi
::$statics[__CLASS__
]['fieldKeys'];
810 * Returns the names of this table
814 public static function getTableName() {
815 return self
::$_tableName;
819 * Returns if this table needs to be logged
823 public function getLog() {
828 * Returns the list of fields that can be imported
830 * @param bool $prefix
834 public static function &import($prefix = FALSE) {
835 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'action_schedule', $prefix, []);
840 * Returns the list of fields that can be exported
842 * @param bool $prefix
846 public static function &export($prefix = FALSE) {
847 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'action_schedule', $prefix, []);
852 * Returns the list of indices
854 * @param bool $localize
858 public static function indices($localize = TRUE) {
860 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;