mirror of
https://github.com/Karaka-Management/oms-Organization.git
synced 2026-02-15 15:58:40 +00:00
create settings installer
This commit is contained in:
parent
8d6b0b7e7b
commit
ee158a7af7
34
Admin/Install/Settings.install.php
Normal file
34
Admin/Install/Settings.install.php
Normal 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,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
@ -43,7 +43,6 @@ class Installer extends InstallerAbstract
|
||||||
parent::install($dbPool, $info);
|
parent::install($dbPool, $info);
|
||||||
|
|
||||||
self::installDefaultUnit();
|
self::installDefaultUnit();
|
||||||
self::installSettings($dbPool);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -60,21 +59,4 @@ class Installer extends InstallerAbstract
|
||||||
|
|
||||||
UnitMapper::create($unit);
|
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]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user