You are here

public function Context::getData in Commerce Core 8.2

Gets a data value with the given key.

Parameters

string $key: The key.

mixed $default: The default value.

Return value

mixed The value.

File

src/Context.php, line 106

Class

Context
Contains known global information (customer, store, time).

Namespace

Drupal\commerce

Code

public function getData(string $key, $default = NULL) {
  return isset($this->data[$key]) ? $this->data[$key] : $default;
}