public function canConvertFrom($source, $targetType)
{
if (is_string($source) && preg_match(UuidValidator::PATTERN_MATCH_UUID, $source)) {
return true;
}
// TODO: The check for "originalImage" is necessary for smooth migration to the new resource/media management. "originalImage" is deprecated, it can be removed in 3 versions.
if (is_array($source) && (isset($source['__identity']) && preg_match(UuidValidator::PATTERN_MATCH_UUID, $source['__identity']) || isset($source['resource']) || isset($source['originalAsset']) || isset($source['originalImage']))) {
return true;
}
return false;
}