You are here

function serial_field_config_delete in Serial Field 8

Implements hook_ENTITY_TYPE_delete().

@inheritdoc

File

./serial.module, line 51
The Serial module main file.

Code

function serial_field_config_delete(FieldConfig $field) {
  if ($field
    ->getType() == 'serial') {
    $serialStorage = \Drupal::getContainer()
      ->get('serial.sql_storage');
    $storageName = $serialStorage
      ->createStorageName($field
      ->getTargetEntityTypeId(), $field
      ->getTargetBundle(), $field
      ->getFieldStorageDefinition()
      ->getName());
    $serialStorage
      ->dropStorageFromName($storageName);
  }
}