setMetadataValues($this->extract($resource)); foreach (array_keys($this->getMetadataValues()) as $identifier) { $this->inject($identifier, $imsManifest); } return $imsManifest; } /** * Extract metadata value form a resource * * {@inheritdoc} */ public function extract($resource) { if (! $resource instanceof \core_kernel_classes_Resource) { throw new MetadataExportException(__('Metadata export requires an instance of core_kernel_classes_Resource to extract metadata')); } return parent::extract($resource); } /** * Inject an identified metadata value to a dom IMS manifest * * {@inheritdoc} */ public function inject($identifier, $imsManifest) { if (! $imsManifest instanceof \DOMDocument) { throw new MetadataExportException(__('Metadata export requires an instance of DomManifest to inject metadata')); } parent::inject($identifier, $imsManifest); } /** * Allow to register, into the config, the current exporter service */ protected function registerMetadataService() { $metadataService = $this->getServiceLocator()->get(MetadataService::SERVICE_ID); $metadataService->setOption(MetadataService::EXPORTER_KEY, $this); $this->getServiceManager()->register(MetadataService::SERVICE_ID, $metadataService); } }