@@ 306-315 (lines=10) @@ | ||
303 | * @param $arguments |
|
304 | * @return AddonCollection |
|
305 | */ |
|
306 | public function __call($method, $arguments) |
|
307 | { |
|
308 | $type = str_singular($method); |
|
309 | ||
310 | if (in_array($type, config('streams::addons.types'))) { |
|
311 | return app("{$type}.collection"); |
|
312 | } |
|
313 | ||
314 | return call_user_func_array([$this, $method], $arguments); |
|
315 | } |
|
316 | ||
317 | /** |
|
318 | * Get a property. |
|
@@ 323-332 (lines=10) @@ | ||
320 | * @param $name |
|
321 | * @return AddonCollection |
|
322 | */ |
|
323 | public function __get($name) |
|
324 | { |
|
325 | $type = str_singular($name); |
|
326 | ||
327 | if (in_array($type, config('streams::addons.types'))) { |
|
328 | return app("{$type}.collection"); |
|
329 | } |
|
330 | ||
331 | return $this->{$name}; |
|
332 | } |
|
333 | } |
|
334 |