ImageInterfaceConverter
class ImageInterfaceConverter extends AssetInterfaceConverter (View source)
This converter transforms to \Neos\Media\Domain\Model\ImageInterface (Image or ImageVariant) objects.
Constants
CONFIGURATION_ONE_PER_RESOURCE |
|
Properties
protected array | $sourceTypes | from AssetInterfaceConverter | |
protected string | $targetType | ||
protected int | $priority | ||
protected AssetRepository | $assetRepository | from AssetInterfaceConverter | |
protected PersistenceManagerInterface | $persistenceManager | from AssetInterfaceConverter | |
protected AssetModelMappingStrategyInterface | $assetModelMappingStrategy | from AssetInterfaceConverter | |
protected ResourceManager | $resourceManager | from AssetInterfaceConverter | |
static protected string | $defaultNewAssetType | If creating a new asset from this converter this defines the default type as fallback. |
|
protected array | $resourcesAlreadyConvertedToAssets | Maps resource identifiers to assets that already got created during the current request. |
from AssetInterfaceConverter |
protected ProcessingInstructionsConverter | $processingInstructionsConverter | ||
protected PropertyMapper | $propertyMapper |
Methods
If $source has an identity, we have a persisted Image, and therefore this type converter should withdraw and let the PersistedObjectConverter kick in.
All properties in the source array except __identity are sub-properties.
Convert the property "resource"
Determines the target type based on the source's (optional) __type key.
Convert an object from $source to an \Neos\Media\Domain\Model\AssetInterface implementation
Builds a new instance of $objectType with the given $possibleConstructorArgumentValues.
Fetch an object from persistence layer.
Converts and adds ImageAdjustments to the ImageVariant
Applies the model mapping strategy for a converted resource to determine the final target type.
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.
array
getSourceChildPropertiesToBeConverted(mixed $source)
All properties in the source array except __identity are sub-properties.
string
getTypeOfChildProperty(string $targetType, string $propertyName, PropertyMappingConfigurationInterface $configuration)
Convert the property "resource"
string
getTargetTypeForSource(mixed $source, string $originalTargetType, PropertyMappingConfigurationInterface $configuration = null)
Determines the target type based on the source's (optional) __type key.
Error|AssetInterface
convertFrom(mixed $source, string $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
Convert an object from $source to an \Neos\Media\Domain\Model\AssetInterface implementation
protected object
buildObject(array $possibleConstructorArgumentValues, string $objectType)
Builds a new instance of $objectType with the given $possibleConstructorArgumentValues.
If constructor argument values are missing from the given array the method looks for a default value in the constructor signature.
Furthermore, the constructor arguments are removed from $possibleConstructorArgumentValues
protected object
fetchObjectFromPersistence(mixed $identity, string $targetType)
Fetch an object from persistence layer.
protected AssetInterface|null
applyTypeSpecificHandling(AssetInterface $asset, mixed $source, array $convertedChildProperties, PropertyMappingConfigurationInterface $configuration)
Converts and adds ImageAdjustments to the ImageVariant
protected string
applyModelMappingStrategy(string $originalTargetType, PersistentResource $resource, array $source = [])
Applies the model mapping strategy for a converted resource to determine the final target type.
The strategy is NOT applied if $source['__type'] is set (overriding was allowed then, otherwise an exception would have been thrown earlier).