1 | <?php |
||
10 | class Indexer |
||
11 | { |
||
12 | /** |
||
13 | * @var int[] |
||
14 | */ |
||
15 | protected $index = []; |
||
16 | |||
17 | /** |
||
18 | * @var Connection |
||
19 | */ |
||
20 | protected $connection; |
||
21 | |||
22 | /** |
||
23 | * Indexer constructor. |
||
24 | * |
||
25 | * @param Connection $connection |
||
26 | */ |
||
27 | 3 | public function __construct(Connection $connection) |
|
31 | |||
32 | /** |
||
33 | * Get connection. |
||
34 | * |
||
35 | * @return Connection |
||
36 | */ |
||
37 | 1 | public function getConnection() |
|
41 | |||
42 | /** |
||
43 | * Index operation. |
||
44 | * |
||
45 | * @param string $key |
||
46 | * The key to index undeer. |
||
47 | * @param Operation $operation |
||
48 | * The operation to index. |
||
49 | * |
||
50 | * @return Operation |
||
51 | * The operation indexed. |
||
52 | */ |
||
53 | 2 | public function index($key, Operation $operation) |
|
65 | |||
66 | /** |
||
67 | * De-index operation. |
||
68 | * |
||
69 | * @param string $key |
||
70 | * The key to index undeer. |
||
71 | * @param Operation $operation |
||
72 | * The operation to index. |
||
73 | * |
||
74 | * @return Operation |
||
75 | * The operation de-indexed. |
||
76 | */ |
||
77 | 1 | public function deIndex($key, Operation $operation) |
|
82 | |||
83 | /** |
||
84 | * Lookup operation. |
||
85 | * |
||
86 | * @param string $key |
||
87 | * The key to look up. |
||
88 | * |
||
89 | * @return array |
||
90 | * Operations. |
||
91 | */ |
||
92 | 2 | public function lookup($key) |
|
96 | } |
||
97 |