function KeyValueEntityStorage::doLoadMultiple

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::doLoadMultiple()
  2. 8.9.x core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::doLoadMultiple()
  3. 10 core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::doLoadMultiple()

Overrides EntityStorageBase::doLoadMultiple

File

core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php, line 121

Class

KeyValueEntityStorage
Provides a key value backend for entities.

Namespace

Drupal\Core\Entity\KeyValueStore

Code

public function doLoadMultiple(?array $ids = NULL) {
    if (empty($ids)) {
        $entities = $this->keyValueStore
            ->getAll();
    }
    else {
        $entities = $this->keyValueStore
            ->getMultiple($ids);
    }
    return $this->mapFromStorageRecords($entities);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.