From ee158a7af72d4d18b15959d2e5de9916ac691ae2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 24 Feb 2020 22:47:04 +0100 Subject: [PATCH] create settings installer --- Admin/Install/Settings.install.php | 34 ++++++++++++++++++++++++++++++ Admin/Installer.php | 18 ---------------- 2 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 Admin/Install/Settings.install.php diff --git a/Admin/Install/Settings.install.php b/Admin/Install/Settings.install.php new file mode 100644 index 0000000..8754f8f --- /dev/null +++ b/Admin/Install/Settings.install.php @@ -0,0 +1,34 @@ + SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_UNIT, + 'content' => '1', + 'module' => ApiController::MODULE_NAME, + ], + [ + 'name' => SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_DEPARTMENT, + 'content' => '1', + 'module' => ApiController::MODULE_NAME, + ], + [ + 'name' => SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_POSITION, + 'content' => '1', + 'module' => ApiController::MODULE_NAME, + ], +]; diff --git a/Admin/Installer.php b/Admin/Installer.php index 644e5b9..ec576ac 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -43,7 +43,6 @@ class Installer extends InstallerAbstract parent::install($dbPool, $info); self::installDefaultUnit(); - self::installSettings($dbPool); } /** @@ -60,21 +59,4 @@ class Installer extends InstallerAbstract UnitMapper::create($unit); } - - /** - * Install settings - * - * @param DatabasePool $dbPool Database pool - * - * @return void - * - * @since 1.0.0 - */ - private static function installSettings(DatabasePool $dbPool) : void - { - $settings = new CoreSettings($dbPool->get('insert')); - $settings->create(['name' => SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_UNIT, 'content' => '1', 'module' => ApiController::MODULE_NAME]); - $settings->create(['name' => SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_DEPARTMENT, 'content' => '1', 'module' => ApiController::MODULE_NAME]); - $settings->create(['name' => SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_POSITION, 'content' => '1', 'module' => ApiController::MODULE_NAME]); - } }