function MediaThumbnailFormatter::needsEntityLoad
Same name in other branches
- 9 core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php \Drupal\media\Plugin\Field\FieldFormatter\MediaThumbnailFormatter::needsEntityLoad()
- 8.9.x core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php \Drupal\media\Plugin\Field\FieldFormatter\MediaThumbnailFormatter::needsEntityLoad()
- 10 core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php \Drupal\media\Plugin\Field\FieldFormatter\MediaThumbnailFormatter::needsEntityLoad()
This has to be overridden 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
-
core/
modules/ media/ src/ Plugin/ Field/ FieldFormatter/ MediaThumbnailFormatter.php, line 96
Class
- MediaThumbnailFormatter
- Plugin implementation of the 'media_thumbnail' formatter.
Namespace
Drupal\media\Plugin\Field\FieldFormatterCode
protected function needsEntityLoad(EntityReferenceItem $item) {
return !$item->hasNewEntity();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.