setOption(AlarmNotificationService::OPTION_NOTIFIERS, []); $this->getServiceManager()->register( $updatingNotificationService::SERVICE_ID, $updatingNotificationService ); /** @var EventManager $eventManager */ $eventManager = $this->getServiceManager()->get(EventManager::SERVICE_ID); $eventManager->attach(TaoUpdateEvent::class, [AlarmNotificationService::SERVICE_ID, 'listenTaoUpdateEvent']); $this->getServiceManager()->register(EventManager::SERVICE_ID, $eventManager); } public function down(Schema $schema): void { /** @var EventManager $eventManager */ $this->getServiceManager()->unregister(AlarmNotificationService::SERVICE_ID); $eventManager = $this->getServiceManager()->get(EventManager::SERVICE_ID); $eventManager->detach(TaoUpdateEvent::class, [AlarmNotificationService::SERVICE_ID, 'listenTaoUpdateEvent']); $this->getServiceManager()->register(EventManager::SERVICE_ID, $eventManager); } }