class ImageInterfaceJsonSerializer extends ImageInterfaceArrayPresenter (View source)

This converter transforms \Neos\Media\Domain\Model\ImageInterface (Image or ImageVariant) objects to json representations.

Properties

protected array $sourceTypes from  ImageInterfaceArrayPresenter
protected string $targetType
protected int $priority
protected PersistenceManagerInterface $persistenceManager from  ImageInterfaceArrayPresenter

Methods

bool
canConvertFrom(mixed $source, string $targetType)

If $source has an identity, we have a persisted Image, and therefore this type converter should withdraw and let the PersistedObjectConverter kick in.

array
getSourceChildPropertiesToBeConverted(mixed $source)

Convert all properties in the source array

string|Error
convertFrom(ImageInterface $source, string $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)

Convert an object from \Neos\Media\Domain\Model\ImageInterface to a json representation.

Details

bool canConvertFrom(mixed $source, string $targetType)

If $source has an identity, we have a persisted Image, and therefore this type converter should withdraw and let the PersistedObjectConverter kick in.

Parameters

mixed $source

The source for the to-build Image

string $targetType

Should always be 'string'

Return Value

bool

array getSourceChildPropertiesToBeConverted(mixed $source)

Convert all properties in the source array

Parameters

mixed $source

Return Value

array

string|Error convertFrom(ImageInterface $source, string $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)

Convert an object from \Neos\Media\Domain\Model\ImageInterface to a json representation.

Parameters

ImageInterface $source
string $targetType

must be 'string'

array $convertedChildProperties
PropertyMappingConfigurationInterface $configuration

Return Value

string|Error

The converted Image, a Validation Error or NULL