function FieldStorageConfig::postSave

Same name in other branches
  1. 8.9.x core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::postSave()
  2. 10 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::postSave()
  3. 11.x core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::postSave()

Overrides EntityBase::postSave

File

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

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.