public function importResourceMetadata(
        array $metadataValues,
        Resource $qtiResource,
        core_kernel_classes_Resource $resource,
        array $ontologyInjectors = array()
    ) {
        // Filter metadata values for this given item.
        $identifier = $qtiResource->getIdentifier();
        if (isset($metadataValues[$identifier]) === true) {
            \common_Logger::i("Preparing Metadata Values for resource '${identifier}'...");
            $values = $metadataValues[$identifier];

            foreach ($ontologyInjectors as $injector) {
                $valuesCount = count($values);
                $injectorClass = get_class($injector);
                \common_Logger::i("Attempting to inject ${valuesCount} Metadata Values in database for resource '${identifier}' with Metadata Injector '${injectorClass}'.");
                $injector->inject($resource, array($identifier => $values));
            }
        }
    }
public function importResourceMetadata(
        array $metadataValues,
        Resource $qtiResource,
        core_kernel_classes_Resource $resource,
        array $ontologyInjectors = array()
    ) {
        // Filter metadata values for this given item.
        $identifier = $qtiResource->getIdentifier();
        if (isset($metadataValues[$identifier]) === true) {
            \common_Logger::i("Preparing Metadata Values for resource '${identifier}'...");
            $values = $metadataValues[$identifier];

            foreach ($ontologyInjectors as $injector) {
                $valuesCount = count($values);
                $injectorClass = get_class($injector);
                \common_Logger::i("Attempting to inject ${valuesCount} Metadata Values in database for resource '${identifier}' with Metadata Injector '${injectorClass}'.");
                $injector->inject($resource, array($identifier => $values));
            }
        }
    }
public function importResourceMetadata ( array $ metadataValues , Resource $ qtiResource , core_kernel_classes_Resource $ resource , array $ ontologyInjectors = array ( ) ) { // Filter metadata values for this given item. $ identifier = $ qtiResource -> getIdentifier ( ) ; if ( isset ( $ metadataValues [ $ identifier ] ) === true ) { \ common_Logger :: i ( "Preparing Metadata Values for resource '${identifier}'..." ) ; $ values = $ metadataValues [ $ identifier ] ; foreach ( $ ontologyInjectors as $ injector ) { $ valuesCount = count ( $ values ) ; $ injectorClass = get_class ( $ injector ) ; \ common_Logger :: i ( "Attempting to inject ${valuesCount} Metadata Values in database for resource '${identifier}' with Metadata Injector '${injectorClass}'." ) ; $ injector -> inject ( $ resource , array ( $ identifier => $ values ) ) ; } } }
Import metadata to a given QTI Item.

@deprecated use MetadataService::getImporter::inject()

@param MetadataValue[] $metadataValues An array of MetadataValue objects.
@param Resource $qtiResource The object representing the QTI Resource, from an IMS Manifest perspective.
@param core_kernel_classes_Resource $resource The object representing the target QTI Item in the Ontology.
@param MetadataInjector[] $ontologyInjectors Implementations of MetadataInjector that will take care to inject the metadata values in the appropriate Ontology Resource Properties.
@throws MetadataInjectionException If an error occurs while importing the metadata.
Import metadata to a given QTI Item .