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'.
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
-
$name The format name
- Returns
- Format
Implemented in DefaultFormatter.
◆ getFormatFromMimeType()
getFormatFromMimeType | ( | $mimeType | ) |
Get the format name for the given mime type.
- Parameters
-
$mimeType The mime type
- Returns
- String
Implemented in DefaultFormatter.
◆ deserialize()
deserialize | ( | Request | $request | ) |
Deserialize Request data into objects.
- Parameters
-
$request The Request instance
Implemented in DefaultFormatter.
◆ serialize()
serialize | ( | Response | $response | ) |
Serialize Response according to the output format.
- Parameters
-
$response The Response instance
Implemented in DefaultFormatter.