add app to installer

This commit is contained in:
Dennis Eichhorn 2021-06-24 00:03:34 +02:00
parent b29219f1ef
commit e1f591e7b8
3 changed files with 13 additions and 13 deletions

View File

@ -16,7 +16,7 @@ namespace Modules\Billing\Admin\Install;
use Model\Setting; use Model\Setting;
use Model\SettingMapper; use Model\SettingMapper;
use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Application\ApplicationAbstract;
/** /**
* Media class. * Media class.
@ -32,15 +32,15 @@ class Media
* Install media providing * Install media providing
* *
* @param string $path Module path * @param string $path Module path
* @param DatabasePool $dbPool Database pool for database interaction * @param ApplicationAbstract $app Application
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function install(string $path, DatabasePool $dbPool) : void public static function install(string $path, ApplicationAbstract $app) : void
{ {
$media = \Modules\Media\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/Media.install.json']); $media = \Modules\Media\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Media.install.json']);
$defaultTemplate = \reset($media['upload'][0]); $defaultTemplate = \reset($media['upload'][0]);

View File

@ -14,7 +14,7 @@ declare(strict_types=1);
namespace Modules\Billing\Admin\Install; namespace Modules\Billing\Admin\Install;
use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Application\ApplicationAbstract;
/** /**
* Navigation class. * Navigation class.
@ -30,14 +30,14 @@ class Navigation
* Install navigation providing * Install navigation providing
* *
* @param string $path Module path * @param string $path Module path
* @param DatabasePool $dbPool Database pool for database interaction * @param ApplicationAbstract $app Application
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function install(string $path, DatabasePool $dbPool) : void public static function install(string $path, ApplicationAbstract $app) : void
{ {
\Modules\Navigation\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/Navigation.install.json']); \Modules\Navigation\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Navigation.install.json']);
} }
} }

View File

@ -15,8 +15,8 @@ declare(strict_types=1);
namespace Modules\Billing\Admin\Install; namespace Modules\Billing\Admin\Install;
use phpOMS\Autoloader; use phpOMS\Autoloader;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\DataStorage\Database\Schema\Builder; use phpOMS\DataStorage\Database\Schema\Builder;
use phpOMS\Application\ApplicationAbstract;
/** /**
* WarehouseManagement class. * WarehouseManagement class.
@ -32,20 +32,20 @@ class WarehouseManagement
* Install comment relation * Install comment relation
* *
* @param string $path Module path * @param string $path Module path
* @param DatabasePool $dbPool Database pool for database interaction * @param ApplicationAbstract $app Application
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function install(string $path, DatabasePool $dbPool) : void public static function install(string $path, ApplicationAbstract $app) : void
{ {
$builder = new Builder($dbPool->get('schema')); $builder = new Builder($app->dbPool->get('schema'));
$builder->alterTable('billing_bill') $builder->alterTable('billing_bill')
->addConstraint('billing_bill_stock_from', 'warehousemgmt_stocklocation', 'warehousemgmt_stocklocation_id') ->addConstraint('billing_bill_stock_from', 'warehousemgmt_stocklocation', 'warehousemgmt_stocklocation_id')
->execute(); ->execute();
$builder = new Builder($dbPool->get('schema')); $builder = new Builder($app->dbPool->get('schema'));
$builder->alterTable('billing_bill') $builder->alterTable('billing_bill')
->addConstraint('billing_bill_stock_to', 'warehousemgmt_stocklocation', 'warehousemgmt_stocklocation_id') ->addConstraint('billing_bill_stock_to', 'warehousemgmt_stocklocation', 'warehousemgmt_stocklocation_id')
->execute(); ->execute();