getServiceLocator()->get(EventManager::SERVICE_ID); } /** * @param Schema $schema * @throws InvalidServiceManagerException * @throws common_Exception */ public function up(Schema $schema): void { $eventManager = $this->getEventManager(); $eventManager->attach( ItemContentClonedEvent::class, [ReplaceCopiedQtiXmlIdentifierListener::class, 'catchItemCreatedFromSource'] ); $this->getServiceManager()->register(EventManager::SERVICE_ID, $eventManager); } /** * @param Schema $schema * @throws common_Exception * @throws InvalidServiceManagerException */ public function down(Schema $schema): void { $eventManager = $this->getEventManager(); $eventManager->detach( ItemContentClonedEvent::class, [ReplaceCopiedQtiXmlIdentifierListener::class, 'catchItemCreatedFromSource'] ); $this->getServiceManager()->register(EventManager::SERVICE_ID, $eventManager); } }