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