function EntityDisplayFormBase::getFieldDefinitions

Same name in other branches
  1. 9 core/modules/field_ui/src/Form/EntityDisplayFormBase.php \Drupal\field_ui\Form\EntityDisplayFormBase::getFieldDefinitions()
  2. 10 core/modules/field_ui/src/Form/EntityDisplayFormBase.php \Drupal\field_ui\Form\EntityDisplayFormBase::getFieldDefinitions()
  3. 11.x 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 157

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);
    });
}

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