public function Handler::batch in JSON-RPC 8
Same name and namespace in other branches
- 2.x src/Handler.php \Drupal\jsonrpc\Handler::batch()
Executes a batch of remote procedure calls.
Parameters
\Drupal\jsonrpc\Object\Request[] $requests: The JSON-RPC requests.
Return value
array The JSON-RPC responses, if any. Notifications are not returned.
Throws
\Drupal\jsonrpc\Exception\JsonRpcException
Overrides HandlerInterface::batch
File
- src/
Handler.php, line 54
Class
- Handler
- Manages all the JSON-RPC business logic.
Namespace
Drupal\jsonrpcCode
public function batch(array $requests) {
return array_filter(array_map(function (Request $request) {
return $this
->doRequest($request);
}, $requests));
}