You are here

protected function AmpMediaImageFormatter::needsEntityLoad in Accelerated Mobile Pages (AMP) 8.3

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/AmpMediaImageFormatter.php, line 36

Class

AmpMediaImageFormatter
Plugin for amp media image formatter.

Namespace

Drupal\amp\Plugin\Field\FieldFormatter

Code

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