3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
13 * This interface defines the set of functions a class needs to implement
14 * to use the CRM/Selector object.
16 * Using this interface allows us to standardize on multiple things including
17 * list display, pagination, sorting and export in multiple formats (CSV is
18 * supported right now, XML support will be added as and when needed
21 * @copyright CiviCRM LLC https://civicrm.org/licensing
23 interface CRM_Core_Selector_API
{
26 * Get pager parameters.
28 * Based on the action, the GET variables and the session state
29 * it adds various key => value pairs to the params array including
31 * status - the status message to display. Modifiers will be defined
32 * to integrate the total count and the current state of the
33 * page: e.g. Displaying Page 3 of 5
34 * csvString - The html string to display for export as csv
35 * rowCount - the number of rows to be included
37 * @param string $action
38 * The action being performed.
39 * @param array $params
40 * The array that the pagerParams will be inserted into.
42 public function getPagerParams($action, &$params);
45 * Returns the sort order array for the given action.
47 * @param string $action
48 * The action being performed.
51 * the elements that can be sorted along with their properties
53 public function &getSortOrder($action);
56 * Returns the column headers as an array of tuples.
58 * (name, sortName (key to the sort array))
60 * @param string $action
61 * The action being performed.
63 * What should the result set include (web/email/csv).
66 * the column headers that need to be displayed
68 public function &getColumnHeaders($action = NULL, $type = NULL);
71 * Returns the number of rows for this action.
73 * @param string $action
74 * The action being performed.
77 * the total number of rows for this action
79 public function getTotalCount($action);
82 * Returns all the rows in the given offset and rowCount.
84 * @param string $action
85 * The action being performed.
87 * The row number to start from.
88 * @param int $rowCount
89 * The number of rows to return.
91 * The sql string that describes the sort order.
93 * What should the result set include (web/email/csv).
96 * the total number of rows for this action
98 public function &getRows($action, $offset, $rowCount, $sort, $type = NULL);
101 * Return the template (.tpl) filename.
103 * @param string $action
104 * The action being performed.
108 public function getTemplateFileName($action = NULL);
111 * Return the filename for the exported CSV.
113 * @param string $type
114 * The type of export required: csv/xml/foaf etc.
117 * the fileName which we will munge to skip spaces and
118 * special characters to avoid various browser issues
120 public function getExportFileName($type = 'csv');