Neos\Media\TypeConverter\AssetInterfaceConverter::fetchObjectFromPersistence PHP Method

fetchObjectFromPersistence() protected method

Fetch an object from persistence layer.
protected fetchObjectFromPersistence ( mixed $identity, string $targetType ) : object
$identity mixed
$targetType string
return object
    protected function fetchObjectFromPersistence($identity, $targetType)
    {
        if ($targetType === Thumbnail::class) {
            $object = $this->persistenceManager->getObjectByIdentifier($identity, $targetType);
        } elseif (is_string($identity)) {
            $object = $this->assetRepository->findByIdentifier($identity);
        } else {
            throw new InvalidSourceException('The identity property "' . $identity . '" is not a string.', 1415817618);
        }
        return $object;
    }