protected function PhotosAlbumCoverImageFormatter::needsEntityLoad in Album Photos 8.5
Same name and namespace in other branches
- 6.0.x src/Plugin/Field/FieldFormatter/PhotosAlbumCoverImageFormatter.php \Drupal\photos\Plugin\Field\FieldFormatter\PhotosAlbumCoverImageFormatter::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
- src/
Plugin/ Field/ FieldFormatter/ PhotosAlbumCoverImageFormatter.php, line 32
Class
- PhotosAlbumCoverImageFormatter
- Plugin implementation of the 'media_thumbnail' formatter.
Namespace
Drupal\photos\Plugin\Field\FieldFormatterCode
protected function needsEntityLoad(EntityReferenceItem $item) {
return !$item
->hasNewEntity();
}