You are here

protected function FileFormatterBase::needsEntityLoad in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/file/src/Plugin/Field/FieldFormatter/FileFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\FileFormatterBase::needsEntityLoad()

Returns whether the entity referenced by an item needs to be loaded.

Parameters

\Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $item: The item to check.

Return value

bool TRUE if the entity needs to be loaded.

Overrides EntityReferenceFormatterBase::needsEntityLoad

File

core/modules/file/src/Plugin/Field/FieldFormatter/FileFormatterBase.php, line 23
Contains \Drupal\file\Plugin\Field\FieldFormatter\FileFormatterBase.

Class

FileFormatterBase
Base class for file formatters.

Namespace

Drupal\file\Plugin\Field\FieldFormatter

Code

protected function needsEntityLoad(EntityReferenceItem $item) {
  return parent::needsEntityLoad($item) && $item
    ->isDisplayed();
}