1 | <?php |
||
7 | class Modules implements RepositoryInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var Application |
||
11 | */ |
||
12 | protected $app; |
||
13 | |||
14 | /** |
||
15 | * @var RepositoryInterface |
||
16 | */ |
||
17 | protected $repository; |
||
18 | |||
19 | /** |
||
20 | * Create a new Modules instance. |
||
21 | * |
||
22 | * @param Application $app |
||
23 | * @param RepositoryInterface $repository |
||
24 | 1 | */ |
|
25 | public function __construct(Application $app, RepositoryInterface $repository) |
||
30 | |||
31 | /** |
||
32 | * Register the module service provider file from all modules. |
||
33 | * |
||
34 | * @return mixed |
||
35 | */ |
||
36 | public function register() |
||
46 | |||
47 | /** |
||
48 | * Register the module service provider. |
||
49 | * |
||
50 | * @param string $properties |
||
51 | * @return string |
||
52 | * @throws \Caffeinated\Modules\Exception\FileMissingException |
||
53 | */ |
||
54 | protected function registerServiceProvider($properties) |
||
62 | |||
63 | /** |
||
64 | * Autoload custom module files. |
||
65 | * |
||
66 | * @param array $properties |
||
67 | * @return void |
||
68 | */ |
||
69 | protected function autoloadFiles($properties) |
||
80 | |||
81 | /** |
||
82 | * Get all modules. |
||
83 | * |
||
84 | * @return Collection |
||
85 | */ |
||
86 | public function all() |
||
90 | |||
91 | /** |
||
92 | * Get all module slugs. |
||
93 | * |
||
94 | * @return array |
||
95 | */ |
||
96 | public function slugs() |
||
100 | |||
101 | /** |
||
102 | * Get modules based on where clause. |
||
103 | * |
||
104 | * @param string $key |
||
105 | * @param mixed $value |
||
106 | * @return Collection |
||
107 | */ |
||
108 | public function where($key, $value) |
||
112 | |||
113 | /** |
||
114 | * Sort modules by given key in ascending order. |
||
115 | * |
||
116 | * @param string $key |
||
117 | * @return Collection |
||
118 | */ |
||
119 | public function sortBy($key) |
||
123 | |||
124 | /** |
||
125 | * Sort modules by given key in ascending order. |
||
126 | * |
||
127 | * @param string $key |
||
128 | * @return Collection |
||
129 | */ |
||
130 | public function sortByDesc($key) |
||
134 | |||
135 | /** |
||
136 | * Check if the given module exists. |
||
137 | * |
||
138 | * @param string $slug |
||
139 | * @return bool |
||
140 | */ |
||
141 | public function exists($slug) |
||
145 | |||
146 | /** |
||
147 | * Returns count of all modules. |
||
148 | * |
||
149 | * @return int |
||
150 | */ |
||
151 | public function count() |
||
155 | |||
156 | /** |
||
157 | * Get modules path. |
||
158 | * |
||
159 | * @return string |
||
160 | */ |
||
161 | public function getPath() |
||
165 | |||
166 | /** |
||
167 | * Set modules path in "RunTime" mode. |
||
168 | * |
||
169 | * @param string $path |
||
170 | * @return object $this |
||
171 | */ |
||
172 | public function setPath($path) |
||
176 | |||
177 | /** |
||
178 | * Get path for the specified module. |
||
179 | * |
||
180 | * @param string $slug |
||
181 | * @return string |
||
182 | */ |
||
183 | public function getModulePath($slug) |
||
187 | |||
188 | /** |
||
189 | * Get modules namespace. |
||
190 | * |
||
191 | * @return string |
||
192 | */ |
||
193 | public function getNamespace() |
||
197 | |||
198 | /** |
||
199 | * Get a module's properties. |
||
200 | * |
||
201 | * @param string $slug |
||
202 | * @return mixed |
||
203 | */ |
||
204 | public function getProperties($slug) |
||
208 | |||
209 | /** |
||
210 | * Get a module property value. |
||
211 | * |
||
212 | * @param string $property |
||
213 | * @param mixed $default |
||
214 | * @return mixed |
||
215 | */ |
||
216 | public function getProperty($property, $default = null) |
||
220 | |||
221 | /** |
||
222 | * Set a module property value. |
||
223 | * |
||
224 | * @param string $property |
||
225 | * @param mixed $value |
||
226 | * @return bool |
||
227 | */ |
||
228 | public function setProperty($property, $value) |
||
232 | |||
233 | /** |
||
234 | * Gets all enabled modules. |
||
235 | * |
||
236 | * @return array |
||
237 | */ |
||
238 | public function enabled() |
||
242 | |||
243 | /** |
||
244 | * Gets all disabled modules. |
||
245 | * |
||
246 | * @return array |
||
247 | */ |
||
248 | public function disabled() |
||
252 | |||
253 | /** |
||
254 | * Check if specified module is enabled. |
||
255 | * |
||
256 | * @param string $slug |
||
257 | * @return bool |
||
258 | */ |
||
259 | public function isEnabled($slug) |
||
263 | |||
264 | /** |
||
265 | * Check if specified module is disabled. |
||
266 | * |
||
267 | * @param string $slug |
||
268 | * @return bool |
||
269 | */ |
||
270 | public function isDisabled($slug) |
||
274 | |||
275 | /** |
||
276 | * Enables the specified module. |
||
277 | * |
||
278 | * @param string $slug |
||
279 | * @return bool |
||
280 | */ |
||
281 | public function enable($slug) |
||
285 | |||
286 | /** |
||
287 | * Disables the specified module. |
||
288 | * |
||
289 | * @param string $slug |
||
290 | * @return bool |
||
291 | */ |
||
292 | public function disable($slug) |
||
296 | |||
297 | public function cache() |
||
301 | |||
302 | /** |
||
303 | * Resolve the correct module namespace. |
||
304 | * |
||
305 | * @param array $properties |
||
306 | */ |
||
307 | private function resolveNamespace($properties) |
||
314 | } |
||
315 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.