FieldConfigListBuilder::load

public 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 89

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;
}
doc_Drupal
2016-10-29 09:11:14
Comments
Leave a Comment

Please login to continue.