You are here

public function TokensReplacementEvent::getData in Hook Event Dispatcher 8

Getter for single data member.

Parameters

string $key: The key for the additional token data, like 'node'.

mixed $default: The default value, if data does not exists.

Return value

mixed The value.

File

src/Event/Token/TokensReplacementEvent.php, line 142

Class

TokensReplacementEvent
Class TokensProvideEvent.

Namespace

Drupal\hook_event_dispatcher\Event\Token

Code

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