function commerce_order_token_info in Commerce Core 8.2
Same name and namespace in other branches
- 7 modules/order/commerce_order.tokens.inc \commerce_order_token_info()
Implements hook_token_info().
File
- modules/
order/ commerce_order.tokens.inc, line 16 - Builds placeholder replacement tokens for order data.
Code
function commerce_order_token_info() {
$entity_type_manager = \Drupal::entityTypeManager();
$entity_type = $entity_type_manager
->getDefinition('commerce_order');
assert($entity_type !== NULL);
$info = [];
$info['tokens']['commerce_order']['url'] = [
'name' => t('URL'),
'description' => t('The URL of the order.'),
];
$info['tokens']['commerce_order']['admin-url'] = [
'name' => t('URL'),
'description' => t('The URL for administrators to view the order.'),
];
return $info;
}