public function DeletedFieldsRepository::addFieldStorageDefinition in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Field/DeletedFieldsRepository.php \Drupal\Core\Field\DeletedFieldsRepository::addFieldStorageDefinition()
Adds a field storage definition object to the deleted list.
Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface $field_storage_definition: A field storage definition object.
Return value
$this
Overrides DeletedFieldsRepositoryInterface::addFieldStorageDefinition
File
- core/
lib/ Drupal/ Core/ Field/ DeletedFieldsRepository.php, line 67
Class
- DeletedFieldsRepository
- Provides a repository for deleted field and field storage objects.
Namespace
Drupal\Core\FieldCode
public function addFieldStorageDefinition(FieldStorageDefinitionInterface $field_storage_definition) {
$deleted_storage_definitions = $this->state
->get('field.storage.deleted', []);
$deleted_storage_definitions[$field_storage_definition
->getUniqueStorageIdentifier()] = $field_storage_definition;
$this->state
->set('field.storage.deleted', $deleted_storage_definitions);
return $this;
}