PHP Class ApiPlatform\Core\EventListener\SerializeListener

Author: Kévin Dunglas ([email protected])
Afficher le fichier Open project: api-platform/core Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Symfony\Component\Serializer\SerializerInterface $serializer, ApiPlatform\Core\Serializer\SerializerContextBuilderInterface $serializerContextBuilder )
onKernelView ( GetResponseForControllerResultEvent $event ) Serializes the data to the requested format.

Private Methods

Méthode Description
serializeRawData ( GetResponseForControllerResultEvent $event, Request $request, object $controllerResult ) Tries to serialize data that are not API resources (e.g. the entrypoint or data returned by a custom controller).

Method Details

__construct() public méthode

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

onKernelView() public méthode

Serializes the data to the requested format.
public onKernelView ( GetResponseForControllerResultEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent