public function PromotionListBuilder::load in Commerce Core 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 PromotionListBuilder::load()
- PromotionListBuilder::buildForm in modules/
promotion/ src/ PromotionListBuilder.php - Form constructor.
File
- modules/
promotion/ src/ PromotionListBuilder.php, line 117
Class
- PromotionListBuilder
- Defines the list builder for promotions.
Namespace
Drupal\commerce_promotionCode
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',
]);
// Load the usage counts for each promotion.
$this->usageCounts += $this->usage
->loadMultiple($entities);
return $entities;
}