protected function DashboardStorage::mapToStorageRecord in Dashboards with Layout Builder 2.0.x
Same name and namespace in other branches
- 8 src/Entity/DashboardStorage.php \Drupal\dashboards\Entity\DashboardStorage::mapToStorageRecord()
Maps from an entity object to the storage record.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity object.
Return value
array The record to store.
Overrides ConfigEntityStorage::mapToStorageRecord
File
- src/
Entity/ DashboardStorage.php, line 30
Class
- DashboardStorage
- Class DashboardStorage.
Namespace
Drupal\dashboards\EntityCode
protected function mapToStorageRecord(EntityInterface $entity) {
$record = parent::mapToStorageRecord($entity);
/**
* @var integer $delta
* @var \Drupal\layout_builder\Section $section
*/
foreach ($record['sections'] as $delta => $section) {
$record['sections'][$delta] = $section
->toArray();
}
return $record;
}