public function SecondMethod::execute in JSON-RPC 2.x
Executes the action with the parameters passed in.
Parameters
\Drupal\jsonrpc\Object\ParameterBag $params: The parameters.
Return value
mixed The result of the execution.
Overrides ExecutableWithParamsInterface::execute
File
- tests/
modules/ jsonrpc_test/ src/ Plugin/ jsonrpc/ Method/ SecondMethod.php, line 25
Class
- SecondMethod
- Second test method.
Namespace
Drupal\jsonrpc_test\Plugin\jsonrpc\MethodCode
public function execute(ParameterBag $params) {
return new Response(Handler::SUPPORTED_VERSION, $this
->currentRequest()
->id(), mt_rand(0, 100), NULL, new HeaderBag([
'foo' => 'oof',
'hello' => NULL,
'bye' => 'bye!',
]));
}