PHP Class ApiPlatform\Core\EventListener\AddFormatListener

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

Public Methods

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

Private Methods

Method 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 method

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

onKernelRequest() public method

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