Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace Modules\Block\Entities; |
||
19 | public function __call($method, $parameters) |
||
20 | { |
||
21 | #i: Convert array to dot notation |
||
22 | $config = implode('.', ['asgard.block.config.relations', $method]); |
||
23 | |||
24 | #i: Relation method resolver |
||
25 | if (config()->has($config)) { |
||
26 | $function = config()->get($config); |
||
27 | |||
28 | return $function($this); |
||
29 | } |
||
30 | |||
31 | #i: No relation found, return the call to parent (Eloquent) to handle it. |
||
32 | return parent::__call($method, $parameters); |
||
33 | } |
||
34 | } |
||
35 |