function Shortcut::postSave
Same name in other branches
- 9 core/modules/shortcut/src/Entity/Shortcut.php \Drupal\shortcut\Entity\Shortcut::postSave()
- 8.9.x core/modules/shortcut/src/Entity/Shortcut.php \Drupal\shortcut\Entity\Shortcut::postSave()
- 10 core/modules/shortcut/src/Entity/Shortcut.php \Drupal\shortcut\Entity\Shortcut::postSave()
Overrides ContentEntityBase::postSave
File
-
core/
modules/ shortcut/ src/ Entity/ Shortcut.php, line 99
Class
- Shortcut
- Defines the shortcut entity class.
Namespace
Drupal\shortcut\EntityCode
public function postSave(EntityStorageInterface $storage, $update = TRUE) {
parent::postSave($storage, $update);
// EntityBase::postSave() calls EntityBase::invalidateTagsOnSave(), which
// only handles the regular cases. The Shortcut entity has one special case:
// a newly created shortcut is *also* added to a shortcut set, so we must
// invalidate the associated shortcut set's cache tag.
if (!$update) {
Cache::invalidateTags($this->getCacheTagsToInvalidate());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.