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 | * This program is free software: you can redistribute it and/or modify |
4 | * it under the terms of the GNU General Public License as published by |
5 | * the Free Software Foundation, either version 3 of the License, or |
6 | * (at your option) any later version. |
7 | * |
8 | * This program is distributed in the hope that it will be useful, |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | * GNU General Public License for more details. |
12 | * |
13 | * You should have received a copy of the GNU General Public License |
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | */ |
16 | |
17 | namespace ORES\Storage; |
18 | |
19 | use InvalidArgumentException; |
20 | |
21 | /** |
22 | * Service interface for retrieving model data from storage. |
23 | * |
24 | * @license GPL-3.0-or-later |
25 | */ |
26 | interface ModelLookup { |
27 | |
28 | /** |
29 | * @param string $model |
30 | * |
31 | * @throws InvalidArgumentException |
32 | * @return int ID of last seen version |
33 | */ |
34 | public function getModelId( $model ); |
35 | |
36 | /** |
37 | * @param string $model |
38 | * |
39 | * @throws InvalidArgumentException |
40 | * @return string version number of the model |
41 | */ |
42 | public function getModelVersion( $model ); |
43 | |
44 | /** |
45 | * Returns models and their latest data from storage |
46 | * |
47 | * @return array[] Array of [ 'id' => int $id, 'version' => string $version ], |
48 | * indexed by model name. |
49 | */ |
50 | public function getModels(); |
51 | |
52 | } |