PHP Class ApiPlatform\Core\EventListener\AddFormatListener

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

Méthodes publiques

Méthode Description
__construct ( Negotiator $negotiator, array $formats )
onKernelRequest ( GetResponseEvent $event ) Sets the applicable format to the HttpFoundation Request.

Private Methods

Méthode Description
addRequestFormats ( Request $request, array $formats ) Adds API formats to the HttpFoundation Request.
getNotAcceptableHttpException ( string $accept, array $mimeTypes = null ) : Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException Retrieves an instance of NotAcceptableHttpException.
populateMimeTypes ( ) Populates the $mimeTypes property.

Method Details

__construct() public méthode

public __construct ( Negotiator $negotiator, array $formats )
$negotiator Negotiation\Negotiator
$formats array

onKernelRequest() public méthode

Sets the applicable format to the HttpFoundation Request.
public onKernelRequest ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent