You are here

public function AmpMetadataListBuilder::load in Accelerated Mobile Pages (AMP) 8

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

src/AmpMetadataListBuilder.php, line 83

Class

AmpMetadataListBuilder
Provides a listing of AMP Metadata entities.

Namespace

Drupal\amp

Code

public function load() {
  $entities = parent::load();

  // Move the Global defaults to the top if they exist.
  if (isset($entities['global'])) {
    return array(
      'global' => $entities['global'],
    ) + $entities;
  }
  else {
    return $entities;
  }
}