create settings installer

This commit is contained in:
Dennis Eichhorn 2020-02-24 22:47:04 +01:00
parent 8d6b0b7e7b
commit ee158a7af7
2 changed files with 34 additions and 18 deletions

View File

@ -0,0 +1,34 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Organization\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use Modules\Organization\Controller\ApiController;
use Modules\Organization\Models\SettingsEnum;
return [
[
'name' => 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,
],
];

View File

@ -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]);
}
}