Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
Settings | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 1 |
runImport | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
12 |
1 | <?php |
2 | |
3 | namespace BO\Zmsdldb\Importer\MySQL; |
4 | |
5 | class Settings extends Base |
6 | { |
7 | protected $getCurrentEntitys = false; |
8 | protected $entityClass = '\\BO\\Zmsdldb\\Importer\\MySQL\\Entity\\Setting'; |
9 | |
10 | public function runImport(): bool |
11 | { |
12 | try { |
13 | $this->importData = array_shift($this->importData); |
14 | |
15 | $settings = $this->importData['settings']; |
16 | $settings['boroughs'] = json_encode(($this->importData['boroughs'] ?? '')); |
17 | $settings['office'] = json_encode(($this->importData['office'] ?? '')); |
18 | |
19 | foreach ($settings as $name => $value) { |
20 | $setting = $this->createEntity(['name' => $name, 'value' => $value]); |
21 | $setting->save(); |
22 | } |
23 | } catch (\Exception $e) { |
24 | throw $e; |
25 | } |
26 | |
27 | return true; |
28 | } |
29 | } |