getTypes(); $targetClass = reset($types); $classProperties = $targetClass->getProperties(true); $properties = []; foreach ($classProperties as $property) { $properties[] = $property->getUri(); } $properties = array_diff($properties, GenericLomOntologyClassificationExtractor::$excludedProperties); foreach ($values as $metadataValues) { /** @var MetadataValue $metadataValue */ foreach ($metadataValues as $metadataValue) { $lang = $metadataValue->getLanguage() ?: DEFAULT_LANG; $path = $metadataValue->getPath(); $valuePath = end($path); if (in_array($valuePath, $properties)) { $prop = $this->getProperty($valuePath); if ($target->getPropertyValuesByLg($prop, $lang)->count() > 0) { $target->editPropertyValueByLg($prop, $metadataValue->getValue(), $lang); } else { $target->setPropertyValueByLg($prop, $metadataValue->getValue(), $lang); } } } } } }