class PaginationParameterFactory in JSON-RPC 8
Same name and namespace in other branches
- 2.x src/ParameterFactory/PaginationParameterFactory.php \Drupal\jsonrpc\ParameterFactory\PaginationParameterFactory
A parameter factory to handle paginated responses.
Hierarchy
- class \Drupal\jsonrpc\ParameterFactory\ParameterFactoryBase extends \Shaper\Transformation\TransformationBase implements ParameterFactoryInterface
- class \Drupal\jsonrpc\ParameterFactory\PaginationParameterFactory
Expanded class hierarchy of PaginationParameterFactory
File
- src/
ParameterFactory/ PaginationParameterFactory.php, line 11
Namespace
Drupal\jsonrpc\ParameterFactoryView source
class PaginationParameterFactory extends ParameterFactoryBase {
/**
* {@inheritdoc}
*/
public static function schema(ParameterDefinitionInterface $parameter_definition) {
return [
'type' => 'object',
'properties' => [
'limit' => [
'type' => 'integer',
'minimum' => 0,
],
'offset' => [
'type' => 'integer',
'minimum' => 0,
],
],
];
}
/**
* {@inheritdoc}
*/
public function getOutputValidator() {
// The input is the same as the output.
return $this
->getInputValidator();
}
/**
* {@inheritdoc}
*/
protected function doTransform($data, Context $context = NULL) {
return $data;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PaginationParameterFactory:: |
protected | function | ||
PaginationParameterFactory:: |
public | function | ||
PaginationParameterFactory:: |
public static | function |
An array representing the JSON Schema for acceptable input to the factory. Overrides ParameterFactoryInterface:: |
|
ParameterFactoryBase:: |
protected | property | The parameter definition. | |
ParameterFactoryBase:: |
protected | property | The validation class for shaper interactions. | |
ParameterFactoryBase:: |
protected | property | The schema validator to ensure the input data adheres to the expectation. | |
ParameterFactoryBase:: |
public static | function |
Instantiates a new instance of this class. Overrides ParameterFactoryInterface:: |
1 |
ParameterFactoryBase:: |
public | function | ||
ParameterFactoryBase:: |
public | function | ParameterFactoryBase constructor. | 1 |