3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
28 namespace Civi\ActionSchedule
;
31 * Interface MappingInterface
32 * @package Civi\ActionSchedule
34 interface MappingInterface
{
39 public function getId();
44 public function getEntity();
47 * Get a printable label for this mapping type.
51 public function getLabel();
54 * Get a printable label to use as the header on the 'value' filter.
58 public function getValueHeader();
61 * Get a printable label to use as the header on the 'status' filter.
65 public function getStatusHeader();
68 * Get a list of value options.
71 * Array(string $value => string $label).
72 * Ex: array(123 => 'Phone Call', 456 => 'Meeting').
74 public function getValueLabels();
77 * Get a list of status options.
79 * @param string|int $value
80 * The list of status options may be contingent upon the selected filter value.
81 * This is the selected filter value.
83 * Array(string $value => string $label).
84 * Ex: Array(123 => 'Completed', 456 => 'Scheduled').
86 public function getStatusLabels($value);
89 * Get a list of available date fields.
92 * Array(string $fieldName => string $fieldLabel).
94 public function getDateFields();
97 * Get a list of recipient types.
99 * Note: A single schedule may filter on *zero* or *one* recipient types.
100 * When an admin chooses a value, it's stored in $schedule->recipient.
103 * array(string $value => string $label).
104 * Ex: array('assignee' => 'Activity Assignee').
106 public function getRecipientTypes();
109 * Get a list of recipients which match the given type.
111 * Note: A single schedule may filter on *multiple* recipients.
112 * When an admin chooses value(s), it's stored in $schedule->recipient_listing.
114 * @param string $recipientType
115 * Ex: 'participant_role'.
117 * Array(mixed $name => string $label).
118 * Ex: array(1 => 'Attendee', 2 => 'Volunteer').
119 * @see getRecipientTypes
121 public function getRecipientListing($recipientType);
124 * Determine whether a schedule based on this mapping is sufficiently
127 * @param \CRM_Core_DAO_ActionSchedule $schedule
129 * Array (string $code => string $message).
130 * List of error messages.
132 public function validateSchedule($schedule);
135 * Generate a query to locate contacts who match the given
138 * @param \CRM_Core_DAO_ActionSchedule $schedule
139 * @param string $phase
140 * See, e.g., RecipientBuilder::PHASE_RELATION_FIRST.
141 * @param array $defaultParams
142 * Default parameters that should be included with query.
143 * @return \CRM_Utils_SQL_Select
144 * @see RecipientBuilder
146 public function createQuery($schedule, $phase, $defaultParams);