You are here

public function Request::__construct in JSON-RPC 2.x

Same name and namespace in other branches
  1. 8 src/Object/Request.php \Drupal\jsonrpc\Object\Request::__construct()

Request constructor.

Parameters

string $version: The JSON-RPC version.

string $method: The RPC service method id.

bool $in_batch: Indicates if the request is part of a batch or not.

mixed|false $id: A string, number or NULL ID. FALSE for notification requests.

\Drupal\jsonrpc\Object\ParameterBag|null $params: The request parameters, if any.

File

src/Object/Request.php, line 59

Class

Request
Request object to help implement JSON RPC's spec for request objects.

Namespace

Drupal\jsonrpc\Object

Code

public function __construct($version, $method, $in_batch = FALSE, $id = FALSE, ParameterBag $params = NULL) {
  $this
    ->assertValidRequest($version, $method, $id);
  $this->version = $version;
  $this->method = $method;
  $this->inBatch = $in_batch;
  $this->params = $params;
  $this->id = $id;
}