| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Modules\Page\Entities; |
||
| 41 | public function __call($method, $parameters) |
||
| 42 | { |
||
| 43 | #i: Convert array to dot notation |
||
| 44 | $config = implode('.', ['asgard.page.config.relations', $method]); |
||
| 45 | |||
| 46 | #i: Relation method resolver |
||
| 47 | if (config()->has($config)) { |
||
| 48 | $function = config()->get($config); |
||
| 49 | |||
| 50 | return $function($this); |
||
| 51 | } |
||
| 52 | |||
| 53 | #i: No relation found, return the call to parent (Eloquent) to handle it. |
||
| 54 | return parent::__call($method, $parameters); |
||
| 55 | } |
||
| 56 | } |
||
| 57 |