You are here

protected function PictureBackgroundFormatterMedia::needsEntityLoad in Picture Background Formatter 8

This has to be overriden because FileFormatterBase expects $item to be of type \Drupal\file\Plugin\Field\FieldType\FileItem and calls isDisplayed() which is not in FieldItemInterface.

Overrides FileFormatterBase::needsEntityLoad

File

src/Plugin/Field/FieldFormatter/PictureBackgroundFormatterMedia.php, line 29

Class

PictureBackgroundFormatterMedia
Plugin implementation of the 'picture_background_formatter_media' formatter.

Namespace

Drupal\picture_background_formatter\Plugin\Field\FieldFormatter

Code

protected function needsEntityLoad(EntityReferenceItem $item) {
  return !$item
    ->hasNewEntity();
}