1 | <?php |
||
7 | class Modules implements ModuleRepositoryInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var \Illuminate\Foundation\Application |
||
11 | */ |
||
12 | protected $app; |
||
13 | |||
14 | /** |
||
15 | * @var \Caffeinated\Modules\Repositories\Interfaces\ModuleRepositoryInterface |
||
16 | */ |
||
17 | protected $repository; |
||
18 | |||
19 | /** |
||
20 | * Constructor method. |
||
21 | * |
||
22 | * @param \Caffeinated\Modules\Repositories\Interfaces\ModuleRepositoryInterface $repository |
||
23 | */ |
||
24 | 1 | public function __construct(Application $app, ModuleRepositoryInterface $repository) |
|
29 | |||
30 | /** |
||
31 | * Register the module service provider file from all modules. |
||
32 | * |
||
33 | * @return mixed |
||
34 | */ |
||
35 | public function register() |
||
43 | |||
44 | /** |
||
45 | * Register the module service provider. |
||
46 | * |
||
47 | * @param string $properties |
||
48 | * @return string |
||
49 | * @throws \Caffeinated\Modules\Exception\FileMissingException |
||
50 | */ |
||
51 | protected function registerServiceProvider($properties) |
||
59 | |||
60 | /** |
||
61 | * Get all modules. |
||
62 | * |
||
63 | * @return Collection |
||
64 | */ |
||
65 | public function all() |
||
69 | |||
70 | /** |
||
71 | * Get all module slugs. |
||
72 | * |
||
73 | * @return array |
||
74 | */ |
||
75 | public function slugs() |
||
79 | |||
80 | /** |
||
81 | * Get modules based on where clause. |
||
82 | * |
||
83 | * @param string $key |
||
84 | * @param mixed $value |
||
85 | * @return Collection |
||
86 | */ |
||
87 | public function where($key, $value) |
||
91 | |||
92 | /** |
||
93 | * Sort modules by given key in ascending order. |
||
94 | * |
||
95 | * @param string $key |
||
96 | * @return Collection |
||
97 | */ |
||
98 | public function sortBy($key) |
||
102 | |||
103 | /** |
||
104 | * Sort modules by given key in ascending order. |
||
105 | * |
||
106 | * @param string $key |
||
107 | * @return Collection |
||
108 | */ |
||
109 | public function sortByDesc($key) |
||
113 | |||
114 | /** |
||
115 | * Check if the given module exists. |
||
116 | * |
||
117 | * @param string $slug |
||
118 | * @return bool |
||
119 | */ |
||
120 | public function exists($slug) |
||
124 | |||
125 | /** |
||
126 | * Returns count of all modules. |
||
127 | * |
||
128 | * @return int |
||
129 | */ |
||
130 | public function count() |
||
134 | |||
135 | /** |
||
136 | * Get modules path. |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | public function getPath() |
||
144 | |||
145 | /** |
||
146 | * Set modules path in "RunTime" mode. |
||
147 | * |
||
148 | * @param string $path |
||
149 | * @return object $this |
||
150 | */ |
||
151 | public function setPath($path) |
||
155 | |||
156 | /** |
||
157 | * Get path for the specified module. |
||
158 | * |
||
159 | * @param string $slug |
||
160 | * @return string |
||
161 | */ |
||
162 | public function getModulePath($slug) |
||
166 | |||
167 | /** |
||
168 | * Get modules namespace. |
||
169 | * |
||
170 | * @return string |
||
171 | */ |
||
172 | public function getNamespace() |
||
176 | |||
177 | /** |
||
178 | * Get a module's properties. |
||
179 | * |
||
180 | * @param string $slug |
||
181 | * @return mixed |
||
182 | */ |
||
183 | public function getProperties($slug) |
||
187 | |||
188 | /** |
||
189 | * Get a module property value. |
||
190 | * |
||
191 | * @param string $property |
||
192 | * @param mixed $default |
||
193 | * @return mixed |
||
194 | */ |
||
195 | public function getProperty($property, $default = null) |
||
199 | |||
200 | /** |
||
201 | * Set a module property value. |
||
202 | * |
||
203 | * @param string $property |
||
204 | * @param mixed $value |
||
205 | * @return bool |
||
206 | */ |
||
207 | public function setProperty($property, $value) |
||
211 | |||
212 | /** |
||
213 | * Gets all enabled modules. |
||
214 | * |
||
215 | * @return array |
||
216 | */ |
||
217 | public function enabled() |
||
221 | |||
222 | /** |
||
223 | * Gets all disabled modules. |
||
224 | * |
||
225 | * @return array |
||
226 | */ |
||
227 | public function disabled() |
||
231 | |||
232 | /** |
||
233 | * Check if specified module is enabled. |
||
234 | * |
||
235 | * @param string $slug |
||
236 | * @return bool |
||
237 | */ |
||
238 | public function isEnabled($slug) |
||
242 | |||
243 | /** |
||
244 | * Check if specified module is disabled. |
||
245 | * |
||
246 | * @param string $slug |
||
247 | * @return bool |
||
248 | */ |
||
249 | public function isDisabled($slug) |
||
253 | |||
254 | /** |
||
255 | * Enables the specified module. |
||
256 | * |
||
257 | * @param string $slug |
||
258 | * @return bool |
||
259 | */ |
||
260 | public function enable($slug) |
||
264 | |||
265 | /** |
||
266 | * Disables the specified module. |
||
267 | * |
||
268 | * @param string $slug |
||
269 | * @return bool |
||
270 | */ |
||
271 | public function disable($slug) |
||
275 | } |
||
276 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.