function DeletedFieldsRepository::addFieldStorageDefinition

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/DeletedFieldsRepository.php \Drupal\Core\Field\DeletedFieldsRepository::addFieldStorageDefinition()
  2. 10 core/lib/Drupal/Core/Field/DeletedFieldsRepository.php \Drupal\Core\Field\DeletedFieldsRepository::addFieldStorageDefinition()
  3. 11.x core/lib/Drupal/Core/Field/DeletedFieldsRepository.php \Drupal\Core\Field\DeletedFieldsRepository::addFieldStorageDefinition()

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\Field

Code

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;
}

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