protected function ImageStyleStorageController::postSave

Overrides \Drupal\Core\Config\Entity\ConfigStorageController::postSave().

Overrides ConfigStorageController::postSave

File

drupal/core/modules/image/lib/Drupal/image/ImageStyleStorageController.php, line 41
Contains \Drupal\image\ImageStyleStorageController.

Class

ImageStyleStorageController
Defines a controller class for image styles.

Namespace

Drupal\image

Code

protected function postSave(EntityInterface $entity, $update) {
  if ($update && !empty($entity->original) && $entity->{$this->idKey} !== $entity->original->{$this->idKey}) {

    // The old image style name needs flushing after a rename.
    image_style_flush($entity->original);

    // Update field instance settings if necessary.
    $this
      ->replaceImageStyle($entity);
  }
}