function FieldConfigBase::postSave
Same name in other branches
- 9 core/lib/Drupal/Core/Field/FieldConfigBase.php \Drupal\Core\Field\FieldConfigBase::postSave()
- 8.9.x core/lib/Drupal/Core/Field/FieldConfigBase.php \Drupal\Core\Field\FieldConfigBase::postSave()
- 11.x core/lib/Drupal/Core/Field/FieldConfigBase.php \Drupal\Core\Field\FieldConfigBase::postSave()
Overrides EntityBase::postSave
File
-
core/
lib/ Drupal/ Core/ Field/ FieldConfigBase.php, line 311
Class
- FieldConfigBase
- Base class for configurable field definitions.
Namespace
Drupal\Core\FieldCode
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();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.