Merge pull request #17462 from eileenmcnaughton/526ex
[civicrm-core.git] / CRM / Contact / BAO / Query / Interface.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * Abstract class for search BAO query objects
20 */
21 abstract class CRM_Contact_BAO_Query_Interface {
22
23 abstract public function &getFields();
24
25 /**
26 * @param string $fieldName
27 * @param $mode
28 * @param $side
29 *
30 * @return mixed
31 */
32 abstract public function from($fieldName, $mode, $side);
33
34 /**
35 * @param $query
36 *
37 * @return null
38 */
39 public function select(&$query) {
40 return NULL;
41 }
42
43 /**
44 * @param $query
45 *
46 * @return null
47 */
48 public function where(&$query) {
49 return NULL;
50 }
51
52 /**
53 * @param $tables
54 *
55 * @return null
56 */
57 public function setTableDependency(&$tables) {
58 return NULL;
59 }
60
61 /**
62 * @param $panes
63 *
64 * @return null
65 */
66 public function registerAdvancedSearchPane(&$panes) {
67 return NULL;
68 }
69
70 /**
71 * @param CRM_Core_Form $form
72 * @param $type
73 *
74 * @return null
75 */
76 public function buildAdvancedSearchPaneForm(&$form, $type) {
77 return NULL;
78 }
79
80 /**
81 * @param $paneTemplatePathArray
82 * @param $type
83 *
84 * @return null
85 */
86 public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type) {
87 return NULL;
88 }
89
90 /**
91 * Describe options for available for use in the search-builder.
92 *
93 * The search builder determines its options by examining the API metadata corresponding to each
94 * search field. This approach assumes that each field has a unique-name (ie that the field's
95 * unique-name in the API matches the unique-name in the search-builder).
96 *
97 * @param array $apiEntities
98 * List of entities whose options should be automatically scanned using API metadata.
99 * @param array $fieldOptions
100 * Keys are field unique-names; values describe how to lookup the options.
101 * For boolean options, use value "yesno". For pseudoconstants/FKs, use the name of an API entity
102 * from which the metadata of the field may be queried. (Yes - that is a mouthful.)
103 * @void
104 */
105 public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) {
106 }
107
108 }