function LayoutBuilderEntityViewDisplayStorage::mapFromStorageRecords

Same name in other branches
  1. 8.9.x core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplayStorage.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplayStorage::mapFromStorageRecords()
  2. 10 core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplayStorage.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplayStorage::mapFromStorageRecords()
  3. 11.x core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplayStorage.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplayStorage::mapFromStorageRecords()

Overrides EntityStorageBase::mapFromStorageRecords

File

core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplayStorage.php, line 34

Class

LayoutBuilderEntityViewDisplayStorage
Provides storage for entity view display entities that have layouts.

Namespace

Drupal\layout_builder\Entity

Code

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

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