You are here

protected function ExtraFieldTypePluginBase::processEntityToken in Entity Extra Field 8

Same name and namespace in other branches
  1. 2.0.x src/ExtraFieldTypePluginBase.php \Drupal\entity_extra_field\ExtraFieldTypePluginBase::processEntityToken()

Process the entity token text.

Parameters

$text: The text that contains the token.

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity that's related to the text; references are based off this.

Return value

string The process entity token.

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException

2 calls to ExtraFieldTypePluginBase::processEntityToken()
ExtraFieldTokenPlugin::getProcessedTokenValue in src/Plugin/ExtraFieldType/ExtraFieldTokenPlugin.php
Get processed token value token.
ExtraFieldViewsPlugin::getViewArguments in src/Plugin/ExtraFieldType/ExtraFieldViewsPlugin.php
Get the view arguments.

File

src/ExtraFieldTypePluginBase.php, line 268

Class

ExtraFieldTypePluginBase
Define extra field type plugin base.

Namespace

Drupal\entity_extra_field

Code

protected function processEntityToken($text, ContentEntityInterface $entity) {
  return $this->token
    ->replace($text, $this
    ->getEntityTokenData($entity), [
    'clear' => TRUE,
  ]);
}