1 | <?php |
||
15 | class JobIndexService implements JobIndexServiceInterface |
||
16 | { |
||
17 | const JOB_INDEX_CACHE_KEY = 'job.index'; |
||
18 | |||
19 | /** |
||
20 | * @var CacheInterface |
||
21 | */ |
||
22 | private $cache; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private $jobIndex = []; |
||
28 | |||
29 | /** |
||
30 | * @param CacheInterface $cache |
||
31 | */ |
||
32 | 7 | public function __construct( |
|
38 | |||
39 | /** |
||
40 | * |
||
41 | */ |
||
42 | 7 | public function __destruct() |
|
46 | |||
47 | /** |
||
48 | * @param string $jobName |
||
49 | * @return $this |
||
50 | */ |
||
51 | 2 | public function addJob($jobName) |
|
56 | |||
57 | /** |
||
58 | * @param array $jobNames |
||
59 | * @return $this |
||
60 | */ |
||
61 | 1 | public function addJobs(array $jobNames) |
|
69 | |||
70 | /** |
||
71 | * @param string $jobName |
||
72 | * @return $this |
||
73 | */ |
||
74 | 2 | public function removeJob($jobName) |
|
82 | |||
83 | /** |
||
84 | * @param array $jobNames |
||
85 | * @return $this |
||
86 | */ |
||
87 | 1 | public function removeJobs(array $jobNames) |
|
95 | |||
96 | /** |
||
97 | * @return $this |
||
98 | */ |
||
99 | 1 | public function resetJobIndex() |
|
104 | |||
105 | /** |
||
106 | * @return array |
||
107 | */ |
||
108 | 1 | public function getJobIndex() |
|
112 | |||
113 | /** |
||
114 | * @param $jobName |
||
115 | * @return bool |
||
116 | */ |
||
117 | 1 | public function isJobInIndex($jobName) |
|
121 | |||
122 | /** |
||
123 | * @return array |
||
124 | */ |
||
125 | 7 | private function getJobIndexFromStorage() |
|
130 | |||
131 | /** |
||
132 | * |
||
133 | */ |
||
134 | 7 | private function setJobIndexToStorage() |
|
138 | } |
||
139 |