You are here

function scheduled_transitions_token_info in Scheduled Transitions 8

Same name and namespace in other branches
  1. 2.x scheduled_transitions.module \scheduled_transitions_token_info()

Implements hook_token_info().

File

./scheduled_transitions.module, line 135

Code

function scheduled_transitions_token_info() : array {
  $type = [
    'name' => \t('Scheduled Transitions'),
    'description' => \t('Tokens related to scheduled transitions.'),
    'needs-data' => 'scheduled-transitions',
  ];
  $scheduledTransitions['to-state'] = [
    'name' => \t('To state'),
    'description' => \t('The name of the state being transitioned to.'),
  ];
  $scheduledTransitions['from-state'] = [
    'name' => \t('From state'),
    'description' => \t('The name of the state being transitioned from.'),
  ];
  $scheduledTransitions['from-revision-id'] = [
    'name' => \t('Target Revision ID'),
    'description' => \t('The revision ID which is being transitioned from.'),
  ];
  $scheduledTransitions['latest-revision-id'] = [
    'name' => \t('Latest Revision ID'),
    'description' => \t('The latest revision ID for an entity before transitioning.'),
  ];
  $scheduledTransitions['latest-revision-id'] = [
    'name' => \t('Latest Revision state'),
    'description' => \t('The latest revision state for an entity before transitioning.'),
  ];
  return [
    'types' => [
      'scheduled-transitions' => $type,
    ],
    'tokens' => [
      'scheduled-transitions' => $scheduledTransitions,
    ],
  ];
}