Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
27 | 6 | public function getSettings($key, $default = null) |
|
28 | { |
||
29 | 6 | $cache_key = $this->settingsCacheKey($key); |
|
30 | |||
31 | 6 | if (Cache::has($cache_key)) { |
|
32 | 4 | return Cache::get($cache_key); |
|
33 | } |
||
34 | |||
35 | 2 | $value = Setting::where('key', $key)->where('owner_id', $this->getKey())->pluck('value')->first(); |
|
36 | |||
37 | 2 | return $value ? $value : $default; |
|
38 | } |
||
39 | |||
52 |