You are here

protected function EntityDisplayFormBase::getFieldDefinitions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/field_ui/src/Form/EntityDisplayFormBase.php \Drupal\field_ui\Form\EntityDisplayFormBase::getFieldDefinitions()
  2. 9 core/modules/field_ui/src/Form/EntityDisplayFormBase.php \Drupal\field_ui\Form\EntityDisplayFormBase::getFieldDefinitions()

Collects the definitions of fields whose display is configurable.

Return value

\Drupal\Core\Field\FieldDefinitionInterface[] The array of field definitions

1 call to EntityDisplayFormBase::getFieldDefinitions()
EntityDisplayFormBase::form in core/modules/field_ui/src/Form/EntityDisplayFormBase.php
Gets the actual form array to be built.

File

core/modules/field_ui/src/Form/EntityDisplayFormBase.php, line 148

Class

EntityDisplayFormBase
Base class for EntityDisplay edit forms.

Namespace

Drupal\field_ui\Form

Code

protected function getFieldDefinitions() {
  $context = $this->displayContext;
  return array_filter($this->entityFieldManager
    ->getFieldDefinitions($this->entity
    ->getTargetEntityTypeId(), $this->entity
    ->getTargetBundle()), function (FieldDefinitionInterface $field_definition) use ($context) {
    return $field_definition
      ->isDisplayConfigurable($context);
  });
}