abstract class RestfulFormatterBase in RESTful 7
@file Contains RestfulFormatterBase.
Hierarchy
- class \RestfulPluginBase implements RestfulPluginInterface
- class \RestfulFormatterBase implements RestfulFormatterInterface
Expanded class hierarchy of RestfulFormatterBase
File
- plugins/
formatter/ RestfulFormatterBase.php, line 8 - Contains RestfulFormatterBase.
View source
abstract class RestfulFormatterBase extends \RestfulPluginBase implements \RestfulFormatterInterface {
/**
* The entity handler containing more info about the request.
*
* @var \RestfulBase
*/
protected $handler;
/**
* Generic constructor.
*
* @param array $plugin
* The formatter plugin definition.
* @param \RestfulBase $handler
* The restful handler that will call the output formatter.
*/
public function __construct(array $plugin, $handler = NULL) {
$this
->setPlugin($plugin);
$this->handler = $handler;
}
/**
* {@inheritdoc}
*/
public function format(array $data) {
return $this
->render($this
->prepare($data));
}
/**
* {@inheritdoc}
*/
public function getContentTypeHeader() {
// Default to the most general content type.
return 'application/hal+json; charset=utf-8';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RestfulFormatterBase:: |
protected | property | The entity handler containing more info about the request. | |
RestfulFormatterBase:: |
public | function |
Formats the un-structured data into the output format. Overrides RestfulFormatterInterface:: |
|
RestfulFormatterBase:: |
public | function |
Returns the content type for the selected output format. Overrides RestfulFormatterInterface:: |
2 |
RestfulFormatterBase:: |
public | function |
Generic constructor. Overrides RestfulPluginBase:: |
|
RestfulFormatterInterface:: |
public | function | Massages the raw data to create a structured array to pass to the renderer. | 2 |
RestfulFormatterInterface:: |
public | function | Renders an array in the selected format. | 2 |
RestfulPluginBase:: |
protected | property | The plugin definition array. | |
RestfulPluginBase:: |
public | function |
Gets information about the restful plugin. Overrides RestfulPluginInterface:: |
|
RestfulPluginBase:: |
public | function |
Gets information about the restful plugin key. Overrides RestfulPluginInterface:: |
|
RestfulPluginBase:: |
public | function |
Sets information about the restful plugin. Overrides RestfulPluginInterface:: |
|
RestfulPluginBase:: |
public | function |
Gets information about the restful plugin key. Overrides RestfulPluginInterface:: |