PHP Class Neos\Flow\Property\TypeConverter\MediaTypeConverter

This TypeConverter is used by default to decode the content of a HTTP request and it currently supports json and xml based media types as well as urlencoded content.
Inheritance: extends AbstractTypeConverter, implements Neos\Flow\Property\TypeConverter\MediaTypeConverterInterface
Mostra file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$priority integer This converter is not used automatically
$sourceTypes string
$targetType string

Public Methods

Method Description
convertFrom ( string $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : array Convert the given $source to $targetType depending on the MediaTypeConverterInterface::CONFIGURATION_MEDIA_TYPE property mapping configuration

Protected Methods

Method Description
convertMediaType ( string $requestBody, string $mediaType ) : array Converts the given request body according to the specified media type Override this method in your custom TypeConverter to support additional media types

Method Details

convertFrom() public method

Convert the given $source to $targetType depending on the MediaTypeConverterInterface::CONFIGURATION_MEDIA_TYPE property mapping configuration
public convertFrom ( string $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : array
$source string the raw request body
$targetType string must be "array"
$convertedChildProperties array
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
return array

convertMediaType() protected method

Converts the given request body according to the specified media type Override this method in your custom TypeConverter to support additional media types
protected convertMediaType ( string $requestBody, string $mediaType ) : array
$requestBody string the raw request body
$mediaType string the configured media type (for example "application/json")
return array

Property Details

$priority protected_oe property

This converter is not used automatically
protected int $priority
return integer

$sourceTypes protected_oe property

protected string $sourceTypes
return string

$targetType protected_oe property

protected string $targetType
return string