registerService( MigrationsService::SERVICE_ID, new MigrationsService([MigrationsService::OPTION_PERSISTENCE_ID => 'default']) ); /** @var EventManager $eventManager */ $eventManager = $this->getServiceManager()->get(EventManager::SERVICE_ID); $eventManager->attach(\common_ext_event_ExtensionInstalled::class, [MigrationsService::SERVICE_ID, 'extensionInstalled']); $this->getServiceManager()->register(EventManager::SERVICE_ID, $eventManager); } public function down(Schema $schema): void { $this->getServiceManager()->unregister(MigrationsService::SERVICE_ID); /** @var EventManager $eventManager */ $eventManager = $this->getServiceManager()->get(EventManager::SERVICE_ID); $eventManager->detach(\common_ext_event_ExtensionInstalled::class, [MigrationsService::SERVICE_ID, 'extensionInstalled']); $this->getServiceManager()->register(EventManager::SERVICE_ID, $eventManager); } }