900c7066d28cc14467dab21889ebcf5b21ee350c
[civicrm-core.git] / CRM / Report / Interface.php
1 <?php
2 // $Id$
3
4 /*
5 +--------------------------------------------------------------------+
6 | CiviCRM version 4.3 |
7 +--------------------------------------------------------------------+
8 | Copyright CiviCRM LLC (c) 2004-2013 |
9 +--------------------------------------------------------------------+
10 | This file is a part of CiviCRM. |
11 | |
12 | CiviCRM is free software; you can copy, modify, and distribute it |
13 | under the terms of the GNU Affero General Public License |
14 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
15 | |
16 | CiviCRM is distributed in the hope that it will be useful, but |
17 | WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
19 | See the GNU Affero General Public License for more details. |
20 | |
21 | You should have received a copy of the GNU Affero General Public |
22 | License and the CiviCRM Licensing Exception along |
23 | with this program; if not, contact CiviCRM LLC |
24 | at info[AT]civicrm[DOT]org. If you have questions about the |
25 | GNU Affero General Public License or the licensing of CiviCRM, |
26 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
27 +--------------------------------------------------------------------+
28 */
29
30 /**
31 *
32 * @package CRM
33 * @copyright CiviCRM LLC (c) 2004-2013
34 * $Id$
35 *
36 */
37 interface CRM_Report_Interface {
38
39 /**
40 * The constructor gets the submitted form values
41 */
42 function __construct(&$formValues);
43
44 /**
45 * Builds the quickform for this search
46 */
47 function buildForm(&$form);
48
49 /**
50 * Builds the search query for various cases. We break it down into finer cases
51 * since you can optimize each query independently. All the functions below return
52 * a sql clause with only SELECT, FROM, WHERE sub-parts. The ORDER BY and LIMIT is
53 * added at a later stage
54 */
55
56 /**
57 * Count of records that match the current input parameters
58 * Used by pager
59 */
60 function count();
61
62 /**
63 * Summary information for the query that can be displayed in the template
64 * This is useful to pass total / sub total information if needed
65 */
66 function summary();
67
68 /**
69 * List of contact ids that match the current input parameters
70 * Used by different tasks. Will be also used to optimize the
71 * 'all' query below to avoid excessive LEFT JOIN blowup
72 */
73 function contactIDs($offset = 0, $rowcount = 0, $sort = NULL);
74
75 /**
76 * Retrieve all the values that match the current input parameters
77 * Used by the selector
78 */
79 function all($offset = 0, $rowcount = 0, $sort = NULL,
80 $includeContactIDs = FALSE
81 );
82
83 /**
84 * The below two functions (from and where) are ONLY used if you want to
85 * expose a custom group as a smart group and be able to send a mailing
86 * to them via CiviMail. civicrm_email should be part of the from clause
87 * The from clause should be a valid sql from clause including the word FROM
88 * CiviMail will pick up the contacts where the email is primary and
89 * is not on hold / opt out / do not email
90 *
91 */
92
93 /**
94 * The from clause for the query
95 */
96 function from();
97
98 /**
99 * The where clause for the query
100 */
101 function where($includeContactIDs = FALSE);
102
103 /**
104 * The template FileName to use to display the results
105 */
106 function templateFile();
107
108 /**
109 * Returns an array of column headers and field names and sort options
110 */
111 function &columns();
112 }
113