You are here

public function BlazyEntityBase::buildElement in Blazy 7

Build individual item contents.

Overrides BlazyFormatterBase::buildElement

2 calls to BlazyEntityBase::buildElement()
BlazyEntityBase::buildElements in src/Plugin/Field/FieldFormatter/BlazyEntityBase.php
Returns media contents.
BlazyEntityReferenceBase::buildElement in src/Plugin/Field/FieldFormatter/BlazyEntityReferenceBase.php
Build individual item contents.
1 method overrides BlazyEntityBase::buildElement()
BlazyEntityReferenceBase::buildElement in src/Plugin/Field/FieldFormatter/BlazyEntityReferenceBase.php
Build individual item contents.

File

src/Plugin/Field/FieldFormatter/BlazyEntityBase.php, line 90

Class

BlazyEntityBase
Base class for entity reference formatters without field details.

Namespace

Drupal\blazy\Plugin\Field\FieldFormatter

Code

public function buildElement(array &$build, $entity, $delta = 0) {
  $build['items'][$delta] = $this
    ->blazyEntity()
    ->entityView($entity->targetType, $entity, $build['settings']) ?: [];
}