function EntityDisplayBase::getFieldDefinition

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/EntityDisplayBase.php \Drupal\Core\Entity\EntityDisplayBase::getFieldDefinition()
  2. 9 core/lib/Drupal/Core/Entity/EntityDisplayBase.php \Drupal\Core\Entity\EntityDisplayBase::getFieldDefinition()
  3. 8.9.x core/lib/Drupal/Core/Entity/EntityDisplayBase.php \Drupal\Core\Entity\EntityDisplayBase::getFieldDefinition()

Gets the field definition of a field.

8 calls to EntityDisplayBase::getFieldDefinition()
EntityDisplayBase::setComponent in core/lib/Drupal/Core/Entity/EntityDisplayBase.php
#[ActionMethod(adminLabel: new TranslatableMarkup('Add component to display'))]
EntityFormDisplay::buildForm in core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
EntityFormDisplay::getPluginCollections in core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
EntityFormDisplay::getRenderer in core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
EntityViewDisplay::getPluginCollections in core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php

... See full list

File

core/lib/Drupal/Core/Entity/EntityDisplayBase.php, line 406

Class

EntityDisplayBase
Provides a common base class for entity view and form displays.

Namespace

Drupal\Core\Entity

Code

protected function getFieldDefinition($field_name) {
  $definitions = $this->getFieldDefinitions();
  return $definitions[$field_name] ?? NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.