Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | /** |
4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License |
6 | * as published by the Free Software Foundation; under version 2 |
7 | * of the License (non-upgradable). |
8 | * |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write to the Free Software |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | * |
18 | * Copyright (c) 2016-2023 (original work) Open Assessment Technologies SA. |
19 | */ |
20 | |
21 | /** |
22 | * @author Jean-Sébastien Conan <jean-sebastien.conan@vesperiagroup.com> |
23 | */ |
24 | |
25 | namespace oat\taoClientDiagnostic\model\storage; |
26 | |
27 | /** |
28 | * Interface PaginatedStorage |
29 | */ |
30 | interface PaginatedStorage extends Storage |
31 | { |
32 | /** |
33 | * The size of a page in the data set |
34 | */ |
35 | public const PAGE_SIZE = 25; |
36 | |
37 | /** |
38 | * Gets an existing record in database by id |
39 | * |
40 | * @param $id |
41 | * @return mixed |
42 | */ |
43 | public function find($id); |
44 | |
45 | /** |
46 | * Gets a page from the storage model based on entity |
47 | * |
48 | * @param int $page The page number |
49 | * @param int $size The size of a page (number of rows) |
50 | * @param array $filter A list of filters (pairs columns => value) |
51 | * @return mixed |
52 | */ |
53 | public function findPage($page = null, $size = self::PAGE_SIZE, $filter = null); |
54 | |
55 | /** |
56 | * Gets the number of rows from the storage model based on entity |
57 | * |
58 | * @param array $filter A list of filters (pairs columns => value) |
59 | * @return int |
60 | */ |
61 | public function count($filter = null); |
62 | |
63 | /** |
64 | * Deletes a row from the storage model based on entity |
65 | * |
66 | * @param $id |
67 | * @param array $filter A list of filters (pairs columns => value) |
68 | * @return mixed |
69 | */ |
70 | public function delete($id, $filter = null); |
71 | } |