PHP Class ApiPlatform\Core\EventListener\DeserializeListener

Author: Kévin Dunglas ([email protected])
显示文件 Open project: api-platform/core Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\Serializer\SerializerInterface $serializer, ApiPlatform\Core\Serializer\SerializerContextBuilderInterface $serializerContextBuilder, array $formats )
onKernelRequest ( GetResponseEvent $event ) Deserializes the data sent in the requested format.

Private Methods

Method Description
getFormat ( Request $request ) : string Extracts the format from the Content-Type header and check that it is supported.

Method Details

__construct() public method

public __construct ( Symfony\Component\Serializer\SerializerInterface $serializer, ApiPlatform\Core\Serializer\SerializerContextBuilderInterface $serializerContextBuilder, array $formats )
$serializer Symfony\Component\Serializer\SerializerInterface
$serializerContextBuilder ApiPlatform\Core\Serializer\SerializerContextBuilderInterface
$formats array

onKernelRequest() public method

Deserializes the data sent in the requested format.
public onKernelRequest ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent