You are here

public function ParameterBag::get in JSON-RPC 8

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

Gets the parameter value by its key.

Parameters

string|int $key: The parameter key.

Return value

mixed The parameter.

File

src/Object/ParameterBag.php, line 47

Class

ParameterBag
Value class to hold multiple parameters.

Namespace

Drupal\jsonrpc\Object

Code

public function get($key) {
  $this
    ->ensure($key);
  return isset($this->parameters[$key]) ? $this->parameters[$key] : NULL;
}