public function FirstMethod::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/ FirstMethod.php, line 27
Class
- FirstMethod
- First test method.
Namespace
Drupal\jsonrpc_test\Plugin\jsonrpc\MethodCode
public function execute(ParameterBag $params) {
return mt_rand(0, 100);
}