You are here

protected function DashboardStorage::mapFromStorageRecords in Dashboards with Layout Builder 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/DashboardStorage.php \Drupal\dashboards\Entity\DashboardStorage::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

File

src/Entity/DashboardStorage.php, line 47

Class

DashboardStorage
Class DashboardStorage.

Namespace

Drupal\dashboards\Entity

Code

protected function mapFromStorageRecords(array $records) {
  foreach ($records as &$record) {
    if (!empty($record['sections'])) {
      $sections =& $record['sections'];
      $sections = array_map([
        Section::class,
        'fromArray',
      ], $sections);
    }
  }
  return parent::mapFromStorageRecords($records);
}