Files
gestalt/kernel/app_modules/gestalt_profile/Gestalt_profileModule.php
2025-06-18 14:50:18 +03:00

43 lines
1.1 KiB
PHP

<?php
namespace kernel\app_modules\gestalt_profile;
use kernel\helpers\Debug;
use kernel\Module;
use kernel\modules\menu\service\MenuService;
use kernel\services\MigrationService;
class Gestalt_profileModule extends Module
{
public MenuService $menuService;
public MigrationService $migrationService;
public function __construct()
{
$this->menuService = new MenuService();
$this->migrationService = new MigrationService();
}
/**
* @throws \Exception
*/
public function init(): void
{
$this->migrationService->runAtPath("{KERNEL_APP_MODULES}/gestalt_profile/migrations");
$this->menuService->createItem([
"label" => "Профили психологов",
"url" => "/admin/gestalt_profile",
"slug" => "gestalt_profile",
]);
}
/**
* @throws \Exception
*/
public function deactivate(): void
{
$this->migrationService->rollbackAtPath("{KERNEL_APP_MODULES}/gestalt_profile/migrations");
$this->menuService->removeItemBySlug("gestalt_profile");
}
}