43 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			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");
 | 
						|
    }
 | 
						|
} |