1 | <?php |
||
10 | abstract class AbstractLoader extends AbstractDataLoader |
||
11 | { |
||
12 | protected $primaryKey; |
||
13 | |||
14 | /** |
||
15 | * @return EE_Base_Class |
||
16 | * @throws EE_Error |
||
17 | * @throws InvalidArgumentException |
||
18 | * @throws InvalidDataTypeException |
||
19 | * @throws InvalidInterfaceException |
||
20 | */ |
||
21 | abstract protected function getQuery(); |
||
22 | |||
23 | /** |
||
24 | * @param array $keys |
||
25 | * |
||
26 | * @return array |
||
27 | * @throws EE_Error |
||
28 | * @throws InvalidArgumentException |
||
29 | * @throws InvalidDataTypeException |
||
30 | * @throws InvalidInterfaceException |
||
31 | */ |
||
32 | abstract protected function getWhereParams(array $keys); |
||
33 | |||
34 | /** |
||
35 | * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded |
||
36 | * values |
||
37 | * |
||
38 | * Note that order of returned values must match exactly the order of keys. |
||
39 | * If some entry is not available for given key - it must include null for the missing key. |
||
40 | * |
||
41 | * For example: |
||
42 | * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] |
||
43 | * |
||
44 | * @param array $keys |
||
45 | * |
||
46 | * @return array |
||
47 | * @throws \Exception |
||
48 | */ |
||
49 | public function loadKeys(array $keys) |
||
78 | } |
||
79 |