You are here

protected function FieldWrapperBase::getFieldOutput in (Entity Reference) Field Formatters 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/FieldWrapperBase.php \Drupal\field_formatter\Plugin\Field\FieldFormatter\FieldWrapperBase::getFieldOutput()
  2. 3.x src/Plugin/Field/FieldFormatter/FieldWrapperBase.php \Drupal\field_formatter\Plugin\Field\FieldFormatter\FieldWrapperBase::getFieldOutput()

Returns the wrapped field output.

1 call to FieldWrapperBase::getFieldOutput()
FieldLink::viewElements in src/Plugin/Field/FieldFormatter/FieldLink.php
Builds a renderable array for a field value.

File

src/Plugin/Field/FieldFormatter/FieldWrapperBase.php, line 277

Class

FieldWrapperBase
Wraps an existing field.

Namespace

Drupal\field_formatter\Plugin\Field\FieldFormatter

Code

protected function getFieldOutput(FieldItemListInterface $items, $langcode) {

  /** @var \Drupal\Core\Entity\FieldableEntityInterface $entity */
  $entity = $items
    ->getEntity();
  $build = $this
    ->getViewDisplay($entity
    ->bundle())
    ->build($entity);
  return isset($build[$this->fieldDefinition
    ->getName()]) ? $build[$this->fieldDefinition
    ->getName()] : [];
}