protected function EntityReferenceFormatterBase::needsEntityLoad in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceFormatterBase.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase::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.
2 calls to EntityReferenceFormatterBase::needsEntityLoad()
- EntityReferenceFormatterBase::prepareView in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldFormatter/ EntityReferenceFormatterBase.php - Loads the entities referenced in that field across all the entities being viewed.
- FileFormatterBase::needsEntityLoad in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FileFormatterBase.php - Returns whether the entity referenced by an item needs to be loaded.
1 method overrides EntityReferenceFormatterBase::needsEntityLoad()
- FileFormatterBase::needsEntityLoad in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FileFormatterBase.php - Returns whether the entity referenced by an item needs to be loaded.
File
- core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldFormatter/ EntityReferenceFormatterBase.php, line 170 - Contains \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase.
Class
- EntityReferenceFormatterBase
- Parent plugin for entity reference formatters.
Namespace
Drupal\Core\Field\Plugin\Field\FieldFormatterCode
protected function needsEntityLoad(EntityReferenceItem $item) {
return !$item
->hasNewEntity();
}