function KeyValueEntityStorage::mapFromStorageRecords
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::mapFromStorageRecords()
Maps from storage records to entity objects.
Parameters
array $records: Associative array of query results, keyed on the entity ID.
Return value
\Drupal\Core\Entity\EntityInterface[] An array of entity objects implementing the EntityInterface.
Overrides EntityStorageBase::mapFromStorageRecords
1 call to KeyValueEntityStorage::mapFromStorageRecords()
- KeyValueEntityStorage::doLoadMultiple in core/
lib/ Drupal/ Core/ Entity/ KeyValueStore/ KeyValueEntityStorage.php - Performs storage-specific loading of entities.
File
-
core/
lib/ Drupal/ Core/ Entity/ KeyValueStore/ KeyValueEntityStorage.php, line 134
Class
- KeyValueEntityStorage
- Provides a key value backend for entities.
Namespace
Drupal\Core\Entity\KeyValueStoreCode
protected function mapFromStorageRecords(array $records) {
$entities = [];
foreach ($records as $record) {
/** @var \Drupal\Core\Entity\EntityInterface $entity */
$entity = $this->doCreate($record);
$entities[$entity->id()] = $entity;
}
return $entities;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.