You are here

protected function ContentEntityStorage::doLoadMultiple in MongoDB 8

Performs storage-specific loading of entities.

Override this method to add custom functionality directly after loading. This is always called, while self::postLoad() is only called when there are actual results.

Parameters

array|null $ids: (optional) An array of entity IDs, or NULL to load all entities.

Return value

\Drupal\Core\Entity\EntityInterface[] Associative array of entities, keyed on the entity ID.

Overrides EntityStorageBase::doLoadMultiple

File

src/Entity/ContentEntityStorage.php, line 364
Contains Drupal\mongodb\Entity\ContentEntityStorage.

Class

ContentEntityStorage

Namespace

Drupal\mongodb\Entity

Code

protected function doLoadMultiple(array $ids = NULL) {
  $find = array();
  if ($ids !== NULL) {
    $find['_id']['$in'] = array_values(array_map('intval', $ids));
  }
  return $this
    ->loadFromMongo('entity', $find);
}