You are here

public static function FieldStorageConfig::postDelete in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::postDelete()

Acts on deleted entities before the delete hook is invoked.

Used after the entities are deleted but before invoking the delete hook.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.

\Drupal\Core\Entity\EntityInterface[] $entities: An array of entities.

Overrides EntityBase::postDelete

File

core/modules/field/src/Entity/FieldStorageConfig.php, line 434

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $fields) {

  // Notify the storage.
  foreach ($fields as $field) {
    if (!$field->deleted) {
      \Drupal::service('field_storage_definition.listener')
        ->onFieldStorageDefinitionDelete($field);
      $field->deleted = TRUE;
    }
  }

  // Unset static flag.
  static::$inDeletion = FALSE;
}