Same name and namespace in other branches
  1. 8.9.x core/modules/field/field.api.php \hook_field_purge_field_storage()
  2. 9 core/modules/field/field.api.php \hook_field_purge_field_storage()

Acts when a field storage definition is being purged.

In field_purge_field_storage(), after the storage definition has been removed from the system, the entity storage has purged stored field data, and the field definitions cache has been cleared, this hook is invoked on all modules to allow them to respond to the field storage being purged.

Parameters

$field_storage \Drupal\field\Entity\FieldStorageConfig: The field storage being purged.

Related topics

1 invocation of hook_field_purge_field_storage()
field_purge_field_storage in core/modules/field/field.purge.inc
Purges a field record from the database.

File

core/modules/field/field.api.php, line 410
Field API documentation.

Code

function hook_field_purge_field_storage(\Drupal\field\Entity\FieldStorageConfig $field_storage) {
  \Drupal::database()
    ->delete('my_module_field_storage_info')
    ->condition('uuid', $field_storage
    ->uuid())
    ->execute();
}