PaginationParameterFactory.php in JSON-RPC 2.x
File
src/ParameterFactory/PaginationParameterFactory.php
View source
<?php
namespace Drupal\jsonrpc\ParameterFactory;
use Drupal\jsonrpc\ParameterDefinitionInterface;
use Shaper\Util\Context;
class PaginationParameterFactory extends ParameterFactoryBase {
public static function schema(ParameterDefinitionInterface $parameter_definition) {
return [
'type' => 'object',
'properties' => [
'limit' => [
'type' => 'integer',
'minimum' => 0,
],
'offset' => [
'type' => 'integer',
'minimum' => 0,
],
],
];
}
public function getOutputValidator() {
return $this
->getInputValidator();
}
protected function doTransform($data, Context $context = NULL) {
return $data;
}
}