CRM-13244 - RecipientBuilder - Move entity-specific bits to ActionMappings
[civicrm-core.git] / Civi / ActionSchedule / MappingInterface.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27
28 namespace Civi\ActionSchedule;
29
30 interface MappingInterface {
31
32 /**
33 * Get a list of value options.
34 *
35 * @return array
36 * Array(string $value => string $label).
37 * Ex: array(123 => 'Phone Call', 456 => 'Meeting').
38 */
39 public function getValueLabels();
40
41 /**
42 * Get a list of status options.
43 *
44 * @param string|int $value
45 * The list of status options may be contingent upon the selected filter value.
46 * This is the selected filter value.
47 * @return array
48 * Array(string $value => string $label).
49 * Ex: Array(123 => 'Completed', 456 => 'Scheduled').
50 */
51 public function getStatusLabels($value);
52
53 /**
54 * Get a list of available date fields.
55 *
56 * @return array
57 * Array(string $fieldName => string $fieldLabel).
58 */
59 public function getDateFields();
60
61 /**
62 * FIXME: Unsure. Not sure how it differs from getRecipientTypes... but it does...
63 *
64 * @param string $recipientType
65 * @return array
66 * Array(mixed $name => string $label).
67 * Ex: array(1 => 'Attendee', 2 => 'Volunteer').
68 */
69 public function getRecipientListing($recipientType);
70
71 /**
72 * FIXME: Unsure. Not sure how it differs from getRecipientListing... but it does...
73 *
74 * @param bool|NULL $noThanksJustKidding
75 * This is ridiculous and should not exist.
76 * If true, don't do our main job.
77 * @return array
78 * array(mixed $value => string $label).
79 * Ex: array('assignee' => 'Activity Assignee').
80 */
81 public function getRecipientTypes($noThanksJustKidding = FALSE);
82
83 /**
84 * Generate a query to locate contacts who match the given
85 * schedule.
86 *
87 * @param \CRM_Core_DAO_ActionSchedule $schedule
88 * @param string $phase
89 * See, e.g., RecipientBuilder::PHASE_RELATION_FIRST.
90 * @return \CRM_Utils_SQL_Select
91 * @see RecipientBuilder
92 */
93 public function createQuery($schedule, $phase);
94
95 }