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

Breadcrumb

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

function FieldConfigBase::postSave

Overrides EntityBase::postSave

File

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

Class

FieldConfigBase
Base class for configurable field definitions.

Namespace

Drupal\Core\Field

Code

public function postSave(EntityStorageInterface $storage, $update = TRUE) {
    // Clear the cache.
    \Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();
    // Invalidate the render cache for all affected entities.
    $entity_type = $this->getFieldStorageDefinition()
        ->getTargetEntityTypeId();
    if ($this->entityTypeManager()
        ->hasHandler($entity_type, 'view_builder')) {
        $this->entityTypeManager()
            ->getViewBuilder($entity_type)
            ->resetCache();
    }
}

API Navigation

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