| Total Complexity | 2 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Setting extends AbstractModel |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Returns the setting, with a default value set if none was found. |
||
| 12 | * |
||
| 13 | * @param string $id unique name of setting |
||
| 14 | * @param mixed $defaultValue |
||
| 15 | * |
||
| 16 | * @return Setting |
||
| 17 | */ |
||
| 18 | public static function get($id, $defaultValue) |
||
| 19 | { |
||
| 20 | $setting = SettingMapper::find($id, $defaultValue); |
||
| 21 | |||
| 22 | return $setting; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Defines the value of the setting |
||
| 27 | * |
||
| 28 | * @param string $id unique name of setting |
||
| 29 | * @param string $value the value to be set |
||
| 30 | */ |
||
| 31 | public static function set($id, $value): void |
||
| 36 | } |
||
| 37 | } |
||
| 38 |