1 | <?php |
||
20 | class EloquentSetting implements SettingInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var SystemSetting |
||
24 | */ |
||
25 | private $model; |
||
26 | |||
27 | /** |
||
28 | * EloquentSetting constructor. |
||
29 | * @param SystemSetting $model |
||
30 | */ |
||
31 | 7 | public function __construct(SystemSetting $model) |
|
35 | |||
36 | /** |
||
37 | * @param array $settings |
||
38 | * @return bool |
||
39 | */ |
||
40 | 6 | public function setSetting(array $settings) |
|
58 | |||
59 | /** |
||
60 | * @param $key |
||
61 | * @param null $default |
||
62 | * @return bool|mixed|string |
||
63 | */ |
||
64 | 1 | public function getSetting($key, $default = null) |
|
78 | |||
79 | /** |
||
80 | * @return array |
||
81 | */ |
||
82 | 4 | public function allToArray() |
|
91 | } |
||
92 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: