You are here

protected function FieldConfigStorageBase::mapToStorageRecord in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Field/FieldConfigStorageBase.php \Drupal\Core\Field\FieldConfigStorageBase::mapToStorageRecord()
  2. 9 core/lib/Drupal/Core/Field/FieldConfigStorageBase.php \Drupal\Core\Field\FieldConfigStorageBase::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

core/lib/Drupal/Core/Field/FieldConfigStorageBase.php, line 41

Class

FieldConfigStorageBase
Base storage class for field config entities.

Namespace

Drupal\Core\Field

Code

protected function mapToStorageRecord(EntityInterface $entity) {
  $record = parent::mapToStorageRecord($entity);
  $class = $this->fieldTypeManager
    ->getPluginClass($record['field_type']);
  $record['settings'] = $class::fieldSettingsToConfigData($record['settings']);
  return $record;
}