Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FieldBlock.php

function FieldBlock::getFieldDefinition

Gets the field definition.

Return value

\Drupal\Core\Field\FieldDefinitionInterface The field definition.

3 calls to FieldBlock::getFieldDefinition()
FieldBlock::blockForm in core/modules/layout_builder/src/Plugin/Block/FieldBlock.php
FieldBlock::formatterSettingsProcessCallback in core/modules/layout_builder/src/Plugin/Block/FieldBlock.php
Render API callback: builds the formatter settings elements.
FieldBlock::getFormatter in core/modules/layout_builder/src/Plugin/Block/FieldBlock.php
Gets the formatter object.

File

core/modules/layout_builder/src/Plugin/Block/FieldBlock.php, line 350

Class

FieldBlock
Provides a block that renders a field from an entity.

Namespace

Drupal\layout_builder\Plugin\Block

Code

protected function getFieldDefinition() {
    if (empty($this->fieldDefinition)) {
        $field_definitions = $this->entityFieldManager
            ->getFieldDefinitions($this->entityTypeId, $this->bundle);
        $this->fieldDefinition = $field_definitions[$this->fieldName];
    }
    return $this->fieldDefinition;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal