function FieldConfigListBuilder::load

Same name in other branches
  1. 9 core/modules/field_ui/src/FieldConfigListBuilder.php \Drupal\field_ui\FieldConfigListBuilder::load()
  2. 10 core/modules/field_ui/src/FieldConfigListBuilder.php \Drupal\field_ui\FieldConfigListBuilder::load()
  3. 11.x core/modules/field_ui/src/FieldConfigListBuilder.php \Drupal\field_ui\FieldConfigListBuilder::load()

Overrides ConfigEntityListBuilder::load

File

core/modules/field_ui/src/FieldConfigListBuilder.php, line 118

Class

FieldConfigListBuilder
Provides lists of field config entities.

Namespace

Drupal\field_ui

Code

public function load() {
    $entities = array_filter($this->entityFieldManager
        ->getFieldDefinitions($this->targetEntityTypeId, $this->targetBundle), function ($field_definition) {
        return $field_definition instanceof FieldConfigInterface;
    });
    // Sort the entities using the entity class's sort() method.
    // See \Drupal\Core\Config\Entity\ConfigEntityBase::sort().
    uasort($entities, [
        $this->entityType
            ->getClass(),
        'sort',
    ]);
    return $entities;
}

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