You are here

public function TokensInfoEvent::addTokenType in Hook Event Dispatcher 8

Add token type.

Parameters

\Drupal\hook_event_dispatcher\Value\TokenType $type: The token type.

File

src/Event/Token/TokensInfoEvent.php, line 37

Class

TokensInfoEvent
Class TokensInfoEvent.

Namespace

Drupal\hook_event_dispatcher\Event\Token

Code

public function addTokenType(TokenType $type) {
  $this->tokenTypes[$type
    ->getType()] = [
    'name' => $type
      ->getName(),
    'description' => $type
      ->getDescription(),
    'needs-data' => $type
      ->getNeedsData(),
  ];
}