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\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();
}
}