cbee54781cb187e0f772b0c55887292f3105b799
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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
;
30 interface MappingInterface
{
35 public function getId();
40 public function getEntity();
43 * Get a printable label for this mapping type.
47 public function getLabel();
50 * Get a printable label to use as the header on the 'value' filter.
54 public function getValueHeader();
57 * Get a printable label to use as the header on the 'status' filter.
61 public function getStatusHeader();
64 * Get a list of value options.
67 * Array(string $value => string $label).
68 * Ex: array(123 => 'Phone Call', 456 => 'Meeting').
70 public function getValueLabels();
73 * Get a list of status options.
75 * @param string|int $value
76 * The list of status options may be contingent upon the selected filter value.
77 * This is the selected filter value.
79 * Array(string $value => string $label).
80 * Ex: Array(123 => 'Completed', 456 => 'Scheduled').
82 public function getStatusLabels($value);
85 * Get a list of available date fields.
88 * Array(string $fieldName => string $fieldLabel).
90 public function getDateFields();
93 * Get a list of recipient types.
95 * Note: A single schedule may filter on *zero* or *one* recipient types.
96 * When an admin chooses a value, it's stored in $schedule->recipient.
99 * array(string $value => string $label).
100 * Ex: array('assignee' => 'Activity Assignee').
102 public function getRecipientTypes();
105 * Get a list of recipients which match the given type.
107 * Note: A single schedule may filter on *multiple* recipients.
108 * When an admin chooses value(s), it's stored in $schedule->recipient_listing.
110 * @param string $recipientType
111 * Ex: 'participant_role'.
113 * Array(mixed $name => string $label).
114 * Ex: array(1 => 'Attendee', 2 => 'Volunteer').
115 * @see getRecipientTypes
117 public function getRecipientListing($recipientType);
120 * Determine whether a schedule based on this mapping is sufficiently
123 * @param \CRM_Core_DAO_ActionSchedule $schedule
125 * Array (string $code => string $message).
126 * List of error messages.
128 public function validateSchedule($schedule);
131 * Generate a query to locate contacts who match the given
134 * @param \CRM_Core_DAO_ActionSchedule $schedule
135 * @param string $phase
136 * See, e.g., RecipientBuilder::PHASE_RELATION_FIRST.
137 * @param array $defaultParams
138 * Default parameters that should be included with query.
139 * @return \CRM_Utils_SQL_Select
140 * @see RecipientBuilder
142 public function createQuery($schedule, $phase, $defaultParams);