Neos.Media/Classes/TypeConverter/ImageInterfaceArrayPresenter.php
public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
    {
        $data = [
            '__identity' => $this->persistenceManager->getIdentifierByObject($source),
            '__type' => TypeHandling::getTypeForValue($source)
        ];

        if ($source instanceof ImageVariant) {
            $data['originalAsset'] = [
                '__identity' => $this->persistenceManager->getIdentifierByObject($source->getOriginalAsset()),
            ];

            $adjustments = [];
            foreach ($source->getAdjustments() as $adjustment) {
                $index = TypeHandling::getTypeForValue($adjustment);
                $adjustments[$index] = [];
                foreach (ObjectAccess::getGettableProperties($adjustment) as $propertyName => $propertyValue) {
                    $adjustments[$index][$propertyName] = $propertyValue;
                }
            }
            $data['adjustments'] = $adjustments;
        }

        return $data;
    }
public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
    {
        $data = [
            '__identity' => $this->persistenceManager->getIdentifierByObject($source),
            '__type' => TypeHandling::getTypeForValue($source)
        ];

        if ($source instanceof ImageVariant) {
            $data['originalAsset'] = [
                '__identity' => $this->persistenceManager->getIdentifierByObject($source->getOriginalAsset()),
            ];

            $adjustments = [];
            foreach ($source->getAdjustments() as $adjustment) {
                $index = TypeHandling::getTypeForValue($adjustment);
                $adjustments[$index] = [];
                foreach (ObjectAccess::getGettableProperties($adjustment) as $propertyName => $propertyValue) {
                    $adjustments[$index][$propertyName] = $propertyValue;
                }
            }
            $data['adjustments'] = $adjustments;
        }

        return $data;
    }
public function convertFrom ( $ source , $ targetType , array $ convertedChildProperties = [ ] , PropertyMappingConfigurationInterface $ configuration = null ) { $ data = [ '__identity' => $ this -> persistenceManager -> getIdentifierByObject ( $ source ) , '__type' => TypeHandling :: getTypeForValue ( $ source ) ] ; if ( $ source instanceof ImageVariant ) { $ data [ 'originalAsset' ] = [ '__identity' => $ this -> persistenceManager -> getIdentifierByObject ( $ source -> getOriginalAsset ( ) ) , ] ; $ adjustments = [ ] ; foreach ( $ source -> getAdjustments ( ) as $ adjustment ) { $ index = TypeHandling :: getTypeForValue ( $ adjustment ) ; $ adjustments [ $ index ] = [ ] ; foreach ( ObjectAccess :: getGettableProperties ( $ adjustment ) as $ propertyName => $ propertyValue ) { $ adjustments [ $ index ] [ $ propertyName ] = $ propertyValue ; } } $ data [ 'adjustments' ] = $ adjustments ; } return $ data ; }
Convert an object from \Neos\Media\Domain\Model\ImageInterface to a json representation

@param ImageInterface $source
@param string $targetType must be 'string'
@param array $convertedChildProperties
@param PropertyMappingConfigurationInterface $configuration
@return string|Error The converted Image, a Validation Error or NULL
Convert an object from \ Neos \ Media \ Domain \ Model \ ImageInterface to a json representation