You are here

public function ShippingMethodListBuilder::load in Commerce Shipping 8.2

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 EntityListBuilder::load

1 call to ShippingMethodListBuilder::load()
ShippingMethodListBuilder::buildForm in src/ShippingMethodListBuilder.php
Form constructor.

File

src/ShippingMethodListBuilder.php, line 84

Class

ShippingMethodListBuilder
Defines the list builder for shipping methods.

Namespace

Drupal\commerce_shipping

Code

public function load() {
  $entity_ids = $this
    ->getEntityIds();
  $entities = $this->storage
    ->loadMultiple($entity_ids);

  // Sort the entities using the entity class's sort() method.
  uasort($entities, [
    $this->entityType
      ->getClass(),
    'sort',
  ]);
  return $entities;
}