Formatter Interface Reference

Detailed Description

Formatter is the single entry point for request/response formatting.

It chooses the configured formatter based on the format property of the request by getting the value XXXFormat from the configuration section 'formats'.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 23 of file Formatter.php.

+ Inheritance diagram for Formatter:

Public Member Functions

 getFormat ($name)
 
 getFormatFromMimeType ($mimeType)
 
 deserialize (Request $request)
 
 serialize (Response $response)
 

Member Function Documentation

◆ getFormat()

getFormat (   $name)

Get a Format instance from it's name.

Parameters
$nameThe format name
Returns
Format

Implemented in DefaultFormatter.

◆ getFormatFromMimeType()

getFormatFromMimeType (   $mimeType)

Get the format name for the given mime type.

Parameters
$mimeTypeThe mime type
Returns
String

Implemented in DefaultFormatter.

◆ deserialize()

deserialize ( Request  $request)

Deserialize Request data into objects.

Parameters
$requestThe Request instance

Implemented in DefaultFormatter.

◆ serialize()

serialize ( Response  $response)

Serialize Response according to the output format.

Parameters
$responseThe Response instance

Implemented in DefaultFormatter.