Conditions | 6 |
Paths | 8 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function execute() |
||
23 | { |
||
24 | if (!$this->section) { |
||
25 | throw new InvalidConfigurationException('The AbstractSettingGroup needs the protected $section property defined in any child class in the format of "Tab/Section"'); |
||
26 | } |
||
27 | |||
28 | if (empty($this->settings)) { |
||
29 | throw new InvalidConfigurationException('The AbstractSettingGroup needs the protected $settings property defined in any child class in the format of ["id" => "value"] ala SettingModifier'); |
||
30 | } |
||
31 | |||
32 | foreach ($this->settings as $setting => $value) { |
||
33 | if ($value !== null) { // Skip items that are null. May help with test performance |
||
34 | $this->set($this->section . '::' . $setting, $value); |
||
35 | } |
||
36 | } |
||
37 | |||
38 | if (!$this->disableSave) { |
||
39 | $this->save->save(); |
||
40 | } |
||
41 | } |
||
42 | } |