You are here

public function DeletedFieldsRepository::removeFieldStorageDefinition in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/DeletedFieldsRepository.php \Drupal\Core\Field\DeletedFieldsRepository::removeFieldStorageDefinition()
  2. 10 core/lib/Drupal/Core/Field/DeletedFieldsRepository.php \Drupal\Core\Field\DeletedFieldsRepository::removeFieldStorageDefinition()

Removes a field storage definition object from the deleted list.

Parameters

\Drupal\Core\Field\FieldStorageDefinitionInterface $field_storage_definition: A field storage definition object.

Return value

$this

Overrides DeletedFieldsRepositoryInterface::removeFieldStorageDefinition

File

core/lib/Drupal/Core/Field/DeletedFieldsRepository.php, line 89

Class

DeletedFieldsRepository
Provides a repository for deleted field and field storage objects.

Namespace

Drupal\Core\Field

Code

public function removeFieldStorageDefinition(FieldStorageDefinitionInterface $field_storage_definition) {
  $deleted_storage_definitions = $this->state
    ->get('field.storage.deleted', []);
  unset($deleted_storage_definitions[$field_storage_definition
    ->getUniqueStorageIdentifier()]);
  $this->state
    ->set('field.storage.deleted', $deleted_storage_definitions);
  return $this;
}