3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
12 namespace Civi\ActionSchedule
;
15 * Interface MappingInterface
16 * @package Civi\ActionSchedule
18 interface MappingInterface
{
23 public function getId();
28 public function getEntity();
31 * Get a printable label for this mapping type.
35 public function getLabel();
38 * Get a printable label to use as the header on the 'value' filter.
42 public function getValueHeader();
45 * Get a printable label to use as the header on the 'status' filter.
49 public function getStatusHeader();
52 * Get a list of value options.
55 * Array(string $value => string $label).
56 * Ex: array(123 => 'Phone Call', 456 => 'Meeting').
58 public function getValueLabels();
61 * Get a list of status options.
63 * @param string|int $value
64 * The list of status options may be contingent upon the selected filter value.
65 * This is the selected filter value.
67 * Array(string $value => string $label).
68 * Ex: Array(123 => 'Completed', 456 => 'Scheduled').
70 public function getStatusLabels($value);
73 * Get a list of available date fields.
76 * Array(string $fieldName => string $fieldLabel).
78 public function getDateFields();
81 * Get a list of recipient types.
83 * Note: A single schedule may filter on *zero* or *one* recipient types.
84 * When an admin chooses a value, it's stored in $schedule->recipient.
87 * array(string $value => string $label).
88 * Ex: array('assignee' => 'Activity Assignee').
90 public function getRecipientTypes();
93 * Get a list of recipients which match the given type.
95 * Note: A single schedule may filter on *multiple* recipients.
96 * When an admin chooses value(s), it's stored in $schedule->recipient_listing.
98 * @param string $recipientType
99 * Ex: 'participant_role'.
101 * Array(mixed $name => string $label).
102 * Ex: array(1 => 'Attendee', 2 => 'Volunteer').
103 * @see getRecipientTypes
105 public function getRecipientListing($recipientType);
108 * Determine whether a schedule based on this mapping is sufficiently
111 * @param \CRM_Core_DAO_ActionSchedule $schedule
113 * Array (string $code => string $message).
114 * List of error messages.
116 public function validateSchedule($schedule);
119 * Generate a query to locate contacts who match the given
122 * @param \CRM_Core_DAO_ActionSchedule $schedule
123 * @param string $phase
124 * See, e.g., RecipientBuilder::PHASE_RELATION_FIRST.
125 * @param array $defaultParams
126 * Default parameters that should be included with query.
127 * @return \CRM_Utils_SQL_Select
128 * @see RecipientBuilder
130 public function createQuery($schedule, $phase, $defaultParams);
133 * Determine whether a schedule based on this mapping should
134 * reset the reminder state if the trigger date changes.
138 * @param \CRM_Core_DAO_ActionSchedule $schedule
140 public function resetOnTriggerDateChange($schedule);