You are here

protected function ExtraFieldEntityLinkPlugin::buildEntityLink in Entity Extra Field 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/ExtraFieldType/ExtraFieldEntityLinkPlugin.php \Drupal\entity_extra_field\Plugin\ExtraFieldType\ExtraFieldEntityLinkPlugin::buildEntityLink()

Build the entity link.

Parameters

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

Return value

\Drupal\Core\Link The entity link instance.

Throws

\Drupal\Core\Entity\EntityMalformedException

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

File

src/Plugin/ExtraFieldType/ExtraFieldEntityLinkPlugin.php, line 127

Class

ExtraFieldEntityLinkPlugin
Define the extra field entity link type.

Namespace

Drupal\entity_extra_field\Plugin\ExtraFieldType

Code

protected function buildEntityLink(EntityInterface $entity) {
  $configuration = $this
    ->getConfiguration();
  return $entity
    ->toLink($configuration['link_text'], $configuration['link_template'], $this
    ->getEntityLinkOptions());
}