You are here

public static function Tokens::info in Content Moderation Notifications 8.3

Token information.

See also

\content_moderation_notifications_token_info()

1 call to Tokens::info()
content_moderation_notifications_token_info in ./content_moderation_notifications.tokens.inc
Implements hook_token_info().

File

src/Tokens.php, line 47

Class

Tokens
Token generation and information class.

Namespace

Drupal\content_moderation_notifications

Code

public static function info() {
  $type = [
    'name' => t('Content moderation states'),
    'description' => t('Content moderation state transition tokens.'),
    'needs-data' => 'entity',
  ];
  $tokens['workflow'] = [
    'name' => t('Workflow'),
    'description' => t('The name of the corresponding workflow.'),
  ];
  $tokens['from-state'] = [
    'name' => t('Old moderation state'),
    'description' => t('The previous state of the moderated content.'),
  ];
  $tokens['to-state'] = [
    'name' => t('Current moderation state'),
    'description' => t('The new/current state of the moderated content.'),
  ];
  return [
    'types' => [
      'content_moderation_notifications' => $type,
    ],
    'tokens' => [
      'content_moderation_notifications' => $tokens,
    ],
  ];
}