Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FieldConfigBase.php

function FieldConfigBase::postDelete

Overrides EntityBase::postDelete

2 calls to FieldConfigBase::postDelete()
FieldConfig::postDelete in core/modules/field/src/Entity/FieldConfig.php
Acts on deleted entities before the delete hook is invoked.
FieldConfig::postDelete in core/modules/field/src/Entity/FieldConfig.php
Acts on deleted entities before the delete hook is invoked.
2 methods override FieldConfigBase::postDelete()
BaseFieldOverride::postDelete in core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php
Acts on deleted entities before the delete hook is invoked.
FieldConfig::postDelete in core/modules/field/src/Entity/FieldConfig.php
Acts on deleted entities before the delete hook is invoked.

File

core/lib/Drupal/Core/Field/FieldConfigBase.php, line 295

Class

FieldConfigBase
Base class for configurable field definitions.

Namespace

Drupal\Core\Field

Code

public static function postDelete(EntityStorageInterface $storage, array $fields) {
    // Clear the cache upfront, to refresh the results of getBundles().
    \Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();
    // Notify the entity storage.
    foreach ($fields as $field) {
        if (!$field->deleted) {
            \Drupal::service('field_definition.listener')->onFieldDefinitionDelete($field);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal