Same name and namespace in other branches
- 3.0.x src/Plugin/Field/FieldFormatter/ColorFieldFormatterCss.php \Drupal\color_field\Plugin\Field\FieldFormatter\ColorFieldFormatterCss::getTokenType()
Gets the token type of the target entity.
If the token entity mapper service is available, it will be used to get the token type. If that service is not available, the target entity type id will be used as a fallback.
Return value
string Token type of the target entity.
1 call to ColorFieldFormatterCss::getTokenType()
- ColorFieldFormatterCss::settingsForm dans src/
Plugin/ Field/ FieldFormatter/ ColorFieldFormatterCss.php
Fichier
-
src/
Plugin/ Field/ FieldFormatter/ ColorFieldFormatterCss.php, line 205
Classe
- ColorFieldFormatterCss
- Plugin implementation of the color_field css declaration formatter.
Namespace
Drupal\color_field\Plugin\Field\FieldFormatterCode
protected function getTokenType() : string {
$entity_type_id = $this->fieldDefinition
->getTargetEntityTypeId();
if (!$this->tokenEntityMapper) {
return $entity_type_id;
}
return $this->tokenEntityMapper
->getTokenTypeForEntityType($entity_type_id, TRUE);
}