function Item::postSave

Same name and namespace in other branches
  1. 8.9.x core/modules/aggregator/src/Entity/Item.php \Drupal\aggregator\Entity\Item::postSave()

Overrides ContentEntityBase::postSave

File

core/modules/aggregator/src/Entity/Item.php, line 223

Class

Item
Defines the aggregator item entity class.

Namespace

Drupal\aggregator\Entity

Code

public function postSave(EntityStorageInterface $storage, $update = TRUE) {
  parent::postSave($storage, $update);
  // Entity::postSave() calls Entity::invalidateTagsOnSave(), which only
  // handles the regular cases. The Item entity has one special case: a newly
  // created Item is *also* associated with a Feed, so we must invalidate the
  // associated Feed'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.