protected function FieldWrapperBase::getFieldOutput in (Entity Reference) Field Formatters 3.x
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldFormatter/FieldWrapperBase.php \Drupal\field_formatter\Plugin\Field\FieldFormatter\FieldWrapperBase::getFieldOutput()
- 8 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\FieldFormatterCode
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()] : [];
}