You are here

public function ImageFieldFormatter::getFieldValue in Entity Embed 8

Get the field value required to pass into the field formatter.

Return value

mixed The field value.

Overrides FileFieldFormatter::getFieldValue

File

src/Plugin/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php, line 94

Class

ImageFieldFormatter
Entity Embed Display reusing image field formatters.

Namespace

Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay

Code

public function getFieldValue() {
  $value = parent::getFieldValue();

  // File field support descriptions, but images do not.
  unset($value['description']);
  $value += array_intersect_key($this
    ->getAttributeValues(), [
    'alt' => '',
    'title' => '',
  ]);
  return $value;
}