protected function getCollectionName($source, PropertyMappingConfigurationInterface $configuration = null)
{
if ($configuration === null) {
return ResourceManager::DEFAULT_PERSISTENT_COLLECTION_NAME;
}
$collectionName = $configuration->getConfigurationValue(ResourceTypeConverter::class, self::CONFIGURATION_COLLECTION_NAME) ?: ResourceManager::DEFAULT_PERSISTENT_COLLECTION_NAME;
if (isset($source['__collectionName']) && $source['__collectionName'] !== '') {
$collectionName = $source['__collectionName'];
}
if ($this->resourceManager->getCollection($collectionName) === null) {
throw new InvalidPropertyMappingConfigurationException(sprintf('The selected resource collection named "%s" does not exist, a resource could not be imported.', $collectionName), 1416687475);
}
return $collectionName;
}