protected function ScheduledTransitionsUtility::tokenReplace in Scheduled Transitions 2.x
Replaces all tokens in a given string with appropriate values.
Parameters
string $text: A string containing replaceable tokens.
\Drupal\scheduled_transitions\ScheduledTransitionsTokenReplacements $replacements: A replacements object.
Return value
string The string with the tokens replaced.
1 call to ScheduledTransitionsUtility::tokenReplace()
- ScheduledTransitionsUtility::generateRevisionLog in src/
ScheduledTransitionsUtility.php - Generates a revision log for a ready to save revision.
File
- src/
ScheduledTransitionsUtility.php, line 246
Class
- ScheduledTransitionsUtility
- Utilities for Scheduled Transitions module.
Namespace
Drupal\scheduled_transitionsCode
protected function tokenReplace(string $text, ScheduledTransitionsTokenReplacements $replacements) : string {
$tokenData = [
'scheduled-transitions' => $replacements
->getReplacements(),
];
return $this->token
->replace($text, $tokenData);
}