You are here

public function TokensReplacementEvent::getData in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/core_event_dispatcher/src/Event/Token/TokensReplacementEvent.php \Drupal\core_event_dispatcher\Event\Token\TokensReplacementEvent::getData()

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

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

Class

TokensReplacementEvent
Class TokensProvideEvent.

Namespace

Drupal\core_event_dispatcher\Event\Token

Code

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