You are here

public function LanguageListBuilder::load in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/language/src/LanguageListBuilder.php \Drupal\language\LanguageListBuilder::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 indexed by their IDs. Returns an empty array if no matching entities are found.

Overrides ConfigEntityListBuilder::load

File

core/modules/language/src/LanguageListBuilder.php, line 85

Class

LanguageListBuilder
Defines a class to build a listing of language entities.

Namespace

Drupal\language

Code

public function load() {
  $entities = $this->storage
    ->loadByProperties([
    'locked' => FALSE,
  ]);

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