Neos\Media\TypeConverter\AssetInterfaceConverter::canConvertFrom PHP Метод

canConvertFrom() публичный Метод

If $source has an identity, we have a persisted Image, and therefore this type converter should withdraw and let the PersistedObjectConverter kick in.
public canConvertFrom ( mixed $source, string $targetType ) : boolean
$source mixed The source for the to-build Image
$targetType string Should always be 'Neos\Media\Domain\Model\ImageInterface'
Результат boolean
    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;
    }