protected function YamlFormTokenManager::setTokenData in YAML Form 8
Get token data based on an entity's type.
Parameters
array $token_data: An array of token data.
\Drupal\Core\Entity\EntityInterface $entity: A YAML Form or YAML Form submission entity.
1 call to YamlFormTokenManager::setTokenData()
- YamlFormTokenManager::replace in src/
YamlFormTokenManager.php - Replace tokens in text.
File
- src/
YamlFormTokenManager.php, line 96
Class
- YamlFormTokenManager
- Defines a class to manage token replacement.
Namespace
Drupal\yamlformCode
protected function setTokenData(array &$token_data, EntityInterface $entity) {
if ($entity instanceof YamlFormSubmissionInterface) {
$token_data['yamlform_submission'] = $entity;
$token_data['yamlform'] = $entity
->getYamlForm();
}
elseif ($entity instanceof YamlFormInterface) {
$token_data['yamlform'] = $entity;
}
}