Detailed Description
Format defines the interface for all format classes.
Format instances are used to map external data representations like JSON, XML/SOAP or HTML to internal ones and vice versa. All data values are supposed to be scalar or array values except for wcmf::lib::model::Node instances, for which each external representation defines a special notation.
Definition at line 25 of file Format.php.
Inheritance diagram for Format:Public Member Functions | |
| getMimeType (Response $response=null) | |
| deserialize (Request $request) | |
| serialize (Response $response) | |
| isCached (Response $response) | |
| getCacheDate (Response $response) | |
| getResponseHeaders (Response $response) | |
Member Function Documentation
◆ getMimeType()
| getMimeType | ( | Response | $response = null | ) |
Get the MIME type of the format.
- Parameters
-
$response (optional)
- Returns
- String
Implemented in JsonFormat, HtmlFormat, GenericFormat, SoapFormat, DownloadFormat, and NullFormat.
◆ deserialize()
| deserialize | ( | Request | $request | ) |
Deserialize Request data from the external representation into Nodes and scalars/arrays.
- Parameters
-
$request The Request instance
Implemented in AbstractFormat.
◆ serialize()
| serialize | ( | Response | $response | ) |
Serialize Response data according to the external representation.
- Parameters
-
$response The Response instance
Implemented in AbstractFormat.
◆ isCached()
| isCached | ( | Response | $response | ) |
Check if the response identified by it's cache id is cached for this format.
- Parameters
-
$response The Response instance
- Returns
- Boolean
Implemented in HtmlFormat, SoapFormat, DownloadFormat, and NullFormat.
◆ getCacheDate()
| getCacheDate | ( | Response | $response | ) |
Get the caching date, if the response is cached.
- Parameters
-
$response The Response instance
- Returns
- DateTime or null, if not cached
Implemented in HtmlFormat, DownloadFormat, SoapFormat, and NullFormat.
◆ getResponseHeaders()
| getResponseHeaders | ( | Response | $response | ) |
Get the response headers.
- Parameters
-
$response The Response instance
- Returns
- Associative array with header names and values
Implemented in DownloadFormat, and AbstractFormat.