function PathAlias::postSave

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

Overrides ContentEntityBase::postSave

File

core/modules/path_alias/src/Entity/PathAlias.php, line 106

Class

PathAlias
Defines the path_alias entity class.

Namespace

Drupal\path_alias\Entity

Code

public function postSave(EntityStorageInterface $storage, $update = TRUE) {
    parent::postSave($storage, $update);
    $alias_manager = \Drupal::service('path_alias.manager');
    $alias_manager->cacheClear($this->getPath());
    if ($update) {
        $alias_manager->cacheClear($this->original
            ->getPath());
    }
}

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