Commit | Line | Data |
---|---|---|
780fd0e3 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 5 | | |
5 | +--------------------------------------------------------------------+ | |
6 | | Copyright CiviCRM LLC (c) 2004-2018 | | |
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 | * Interface CRM_Core_PrevNextCache_Interface | |
30 | * | |
31 | * The previous/next cache is a service for tracking query results. Results | |
32 | * are stored in a cache, and they may be individually toggled. | |
33 | */ | |
34 | interface CRM_Core_PrevNextCache_Interface { | |
35 | ||
32a2c024 TO |
36 | /** |
37 | * Store the results of a SQL query in the cache. | |
38 | * | |
83068a64 | 39 | * @param string $cacheKey |
32a2c024 TO |
40 | * @param string $sql |
41 | * A SQL query. The query *MUST* be a SELECT statement which yields | |
42 | * the following columns (in order): entity_table, entity_id1, entity_id2, cacheKey, data | |
43 | * @return bool | |
44 | */ | |
45 | public function fillWithSql($cacheKey, $sql); | |
46 | ||
83068a64 TO |
47 | /** |
48 | * Store the contents of an array in the cache. | |
49 | * | |
50 | * @param string $cacheKey | |
51 | * @param array $rows | |
52 | * A list of cache records. Each record should have keys: | |
53 | * - entity_table | |
54 | * - entity_id1 | |
55 | * - entity_id2 | |
56 | * - data | |
57 | * @return bool | |
58 | */ | |
59 | public function fillWithArray($cacheKey, $rows); | |
60 | ||
0b8038a6 TO |
61 | /** |
62 | * Save checkbox selections. | |
63 | * | |
64 | * @param string $cacheKey | |
65 | * @param string $action | |
66 | * Ex: 'select', 'unselect'. | |
67 | * @param array|int|NULL $cIds | |
68 | * A list of contact IDs to (un)select. | |
69 | * To unselect all contact IDs, use NULL. | |
70 | * @param string $entity_table | |
71 | * Ex: 'civicrm_contact'. | |
72 | */ | |
73 | public function markSelection($cacheKey, $action = 'unselect', $cIds = NULL, $entity_table = 'civicrm_contact'); | |
74 | ||
b7994703 TO |
75 | /** |
76 | * Get the selections. | |
77 | * | |
78 | * @param string $cacheKey | |
79 | * Cache key. | |
80 | * @param string $action | |
81 | * Action. | |
82 | * $action : get - get only selection records | |
83 | * getall - get all the records of the specified cache key | |
84 | * @param string $entity_table | |
85 | * Entity table. | |
86 | * | |
87 | * @return array|NULL | |
88 | */ | |
89 | public function getSelection($cacheKey, $action = 'get', $entity_table = 'civicrm_contact'); | |
90 | ||
780fd0e3 | 91 | } |