1 | <?php |
||
19 | class Memory implements DataSourceInterface |
||
20 | { |
||
21 | const SUMMARY_KEY = 'summary'; |
||
22 | |||
23 | protected $memory = []; |
||
24 | |||
25 | /** |
||
26 | * @param int $offset |
||
27 | * @param int $limit |
||
28 | * |
||
29 | * @return mixed |
||
30 | */ |
||
31 | 4 | public function all($offset = 0, $limit = 15) |
|
41 | |||
42 | /** |
||
43 | * @return mixed |
||
44 | */ |
||
45 | 14 | public function count() |
|
49 | |||
50 | /** |
||
51 | * @param $processId |
||
52 | * |
||
53 | * @return \Generator |
||
54 | */ |
||
55 | 6 | public function getProcess($processId) |
|
63 | |||
64 | /** |
||
65 | * @return mixed |
||
66 | */ |
||
67 | 2 | public function clear() |
|
71 | |||
72 | /** |
||
73 | * @param $processId |
||
74 | * |
||
75 | * @return mixed |
||
76 | */ |
||
77 | 2 | public function deleteProcess($processId) |
|
83 | |||
84 | /** |
||
85 | * @param Process $process |
||
86 | * @param array $item |
||
87 | * |
||
88 | * @return mixed |
||
89 | */ |
||
90 | 62 | public function save(Process $process, array $item) |
|
95 | |||
96 | /** |
||
97 | * @param Process $process |
||
98 | * @param array $item |
||
99 | * |
||
100 | * @return mixed |
||
101 | */ |
||
102 | 8 | public function saveSummary(Process $process, array $item) |
|
114 | |||
115 | 66 | protected function initiateMemoryProcess(Process $process) |
|
121 | } |
||
122 |