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

Breadcrumb

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

function ImageStyle::postSave

Overrides EntityBase::postSave

File

core/modules/image/src/Entity/ImageStyle.php, line 115

Class

ImageStyle
Defines an image style configuration entity.

Namespace

Drupal\image\Entity

Code

public function postSave(EntityStorageInterface $storage, $update = TRUE) {
    parent::postSave($storage, $update);
    if ($update) {
        if (!empty($this->original) && $this->id() !== $this->original
            ->id()) {
            // The old image style name needs flushing after a rename.
            $this->original
                ->flush();
            // Update field settings if necessary.
            if (!$this->isSyncing()) {
                static::replaceImageStyle($this);
            }
        }
        else {
            // Flush image style when updating without changing the name.
            $this->flush();
        }
    }
}

API Navigation

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