phpcs - Fix error, "Expected 1 newline at end of file; XXX found".
[civicrm-core.git] / CRM / Contact / Form / Search / Interface.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
39de6fd5 4 | CiviCRM version 4.6 |
6a488035 5 +--------------------------------------------------------------------+
06b69b18 6 | Copyright CiviCRM LLC (c) 2004-2014 |
6a488035
TO
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/**
29 *
30 * @package CRM
06b69b18 31 * @copyright CiviCRM LLC (c) 2004-2014
6a488035
TO
32 * $Id$
33 *
34 */
35interface CRM_Contact_Form_Search_Interface {
36
37 /**
38 * The constructor gets the submitted form values
39 */
00be9182 40 public function __construct(&$formValues);
6a488035
TO
41
42 /**
43 * Builds the quickform for this search
44 */
00be9182 45 public function buildForm(&$form);
6a488035
TO
46
47 /**
48 * Builds the search query for various cases. We break it down into finer cases
49 * since you can optimize each query independently. All the functions below return
50 * a sql clause with only SELECT, FROM, WHERE sub-parts. The ORDER BY and LIMIT is
51 * added at a later stage
52 */
53
54 /**
55 * Count of records that match the current input parameters
56 * Used by pager
57 */
00be9182 58 public function count();
6a488035
TO
59
60 /**
61 * Summary information for the query that can be displayed in the template
62 * This is useful to pass total / sub total information if needed
63 */
00be9182 64 public function summary();
6a488035
TO
65
66 /**
67 * List of contact ids that match the current input parameters
68 * Used by different tasks. Will be also used to optimize the
69 * 'all' query below to avoid excessive LEFT JOIN blowup
70 */
00be9182 71 public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL);
6a488035
TO
72
73 /**
74 * Retrieve all the values that match the current input parameters
75 * Used by the selector
76 */
00be9182 77 public function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE);
6a488035
TO
78
79 /**
80 * The below two functions (from and where) are ONLY used if you want to
81 * expose a custom group as a smart group and be able to send a mailing
82 * to them via CiviMail. civicrm_email should be part of the from clause
83 * The from clause should be a valid sql from clause including the word FROM
84 * CiviMail will pick up the contacts where the email is primary and
85 * is not on hold / opt out / do not email
86 *
87 */
88
89 /**
90 * The from clause for the query
91 */
00be9182 92 public function from();
6a488035
TO
93
94 /**
95 * The where clause for the query
96 */
00be9182 97 public function where($includeContactIDs = FALSE);
6a488035
TO
98
99 /**
100 * The template FileName to use to display the results
101 */
00be9182 102 public function templateFile();
6a488035
TO
103
104 /**
105 * Returns an array of column headers and field names and sort options
106 */
00be9182 107 public function &columns();
6a488035 108}