protected function MediaThumbnailFormatter::needsEntityLoad in Media entity 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/ MediaThumbnailFormatter.php, line 87
Class
- MediaThumbnailFormatter
- Plugin implementation of the 'media_thumbnail' formatter.
Namespace
Drupal\media_entity\Plugin\Field\FieldFormatterCode
protected function needsEntityLoad(EntityReferenceItem $item) {
return !$item
->hasNewEntity();
}