You are here

public function Request::getParameter in JSON-RPC 8

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

Gets a parameter by key.

Parameters

string $key: The key.

Return value

mixed|null The parameter.

File

src/Object/Request.php, line 117

Class

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

Namespace

Drupal\jsonrpc\Object

Code

public function getParameter($key) {
  if ($this
    ->hasParams() && ($param_value = $this
    ->getParams()
    ->get($key))) {
    return $param_value;
  }
  return NULL;
}