You are here

protected function ExtraFieldBlock::getEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Plugin/Block/ExtraFieldBlock.php \Drupal\layout_builder\Plugin\Block\ExtraFieldBlock::getEntity()
  2. 9 core/modules/layout_builder/src/Plugin/Block/ExtraFieldBlock.php \Drupal\layout_builder\Plugin\Block\ExtraFieldBlock::getEntity()

Gets the entity that has the field.

Return value

\Drupal\Core\Entity\FieldableEntityInterface The entity.

File

core/modules/layout_builder/src/Plugin/Block/ExtraFieldBlock.php, line 114

Class

ExtraFieldBlock
Provides a block that renders an extra field from an entity.

Namespace

Drupal\layout_builder\Plugin\Block

Code

protected function getEntity() {
  return $this
    ->getContextValue('entity');
}