You are here

protected function ExtraFieldTypePluginBase::processEntityToken in Entity Extra Field 2.0.x

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

Process the entity token text.

Parameters

string $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 267

Class

ExtraFieldTypePluginBase
Define extra field type plugin base.

Namespace

Drupal\entity_extra_field

Code

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