You are here

protected function ExtraFieldTokenPlugin::getProcessedTokenValue in Entity Extra Field 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/ExtraFieldType/ExtraFieldTokenPlugin.php \Drupal\entity_extra_field\Plugin\ExtraFieldType\ExtraFieldTokenPlugin::getProcessedTokenValue()

Get processed token value token.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The content entity.

Return value

string The process token value.

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to ExtraFieldTokenPlugin::getProcessedTokenValue()
ExtraFieldTokenPlugin::build in src/Plugin/ExtraFieldType/ExtraFieldTokenPlugin.php
Build the render array of the extra field type contents.

File

src/Plugin/ExtraFieldType/ExtraFieldTokenPlugin.php, line 151

Class

ExtraFieldTokenPlugin
Define extra field token plugin.

Namespace

Drupal\entity_extra_field\Plugin\ExtraFieldType

Code

protected function getProcessedTokenValue(ContentEntityInterface $entity) : string {
  $configuration = $this
    ->getConfiguration();
  $token_value = is_array($configuration['token']) ? $configuration['token']['value'] : $configuration['token'];
  return $this
    ->processEntityToken($token_value, $entity);
}