You are here

protected function TermMatcher::buildDescription in Linkit 8.5

Same name and namespace in other branches
  1. 8.4 src/Plugin/Linkit/Matcher/TermMatcher.php \Drupal\linkit\Plugin\Linkit\Matcher\TermMatcher::buildDescription()

Builds the metadata string used in the suggestion.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The matched entity.

Return value

string The metadata for this entity.

Overrides EntityMatcher::buildDescription

File

src/Plugin/Linkit/Matcher/TermMatcher.php, line 42

Class

TermMatcher
Provides specific linkit matchers for the taxonomy_term entity type.

Namespace

Drupal\linkit\Plugin\Linkit\Matcher

Code

protected function buildDescription(EntityInterface $entity) {
  $description = \Drupal::token()
    ->replace($this->configuration['metadata'], [
    'term' => $entity,
  ], []);
  return LinkitXss::descriptionFilter($description);
}