getServiceLocator()->get(EventManager::SERVICE_ID); $eventManager->attach( DeliveryExecutionState::class, [ DeliveryExecutionStateListener::class, 'updateRemainingTime' ] ); $this->getServiceLocator()->register(EventManager::SERVICE_ID , $eventManager); } public function down(Schema $schema): void { /** @var EventManager $eventManager */ $eventManager = $this->getServiceLocator()->get(EventManager::SERVICE_ID); $eventManager->detach( DeliveryExecutionState::class, [ DeliveryExecutionStateListener::class, 'updateRemainingTime' ] ); $this->getServiceLocator()->register(EventManager::SERVICE_ID , $eventManager); } }