You are here

protected function BaseFieldOverride::getBaseFieldDefinition in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php \Drupal\Core\Field\Entity\BaseFieldOverride::getBaseFieldDefinition()

Gets the base field definition.

Return value

\Drupal\Core\Field\BaseFieldDefinition

1 call to BaseFieldOverride::getBaseFieldDefinition()
BaseFieldOverride::preSave in core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php

File

core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php, line 162

Class

BaseFieldOverride
Defines the base field override entity.

Namespace

Drupal\Core\Field\Entity

Code

protected function getBaseFieldDefinition() {
  if (!isset($this->baseFieldDefinition)) {
    $fields = \Drupal::service('entity_field.manager')
      ->getBaseFieldDefinitions($this->entity_type);
    $this->baseFieldDefinition = $fields[$this
      ->getName()];
  }
  return $this->baseFieldDefinition;
}