You are here

public function FieldConfigListBuilder::load in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field_ui/src/FieldConfigListBuilder.php \Drupal\field_ui\FieldConfigListBuilder::load()

Loads entities of this type from storage for listing.

This allows the implementation to manipulate the listing, like filtering or sorting the loaded entities.

Return value

\Drupal\Core\Entity\EntityInterface[] An array of entities implementing \Drupal\Core\Entity\EntityInterface.

Overrides ConfigEntityListBuilder::load

File

core/modules/field_ui/src/FieldConfigListBuilder.php, line 94
Contains \Drupal\field_ui\FieldConfigListBuilder.

Class

FieldConfigListBuilder
Provides lists of field config entities.

Namespace

Drupal\field_ui

Code

public function load() {
  $entities = array_filter($this->entityManager
    ->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, array(
    $this->entityType
      ->getClass(),
    'sort',
  ));
  return $entities;
}