You are here

protected function WebformEntityStorage::doPostSave in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformEntityStorage.php \Drupal\webform\WebformEntityStorage::doPostSave()

Performs post save entity processing.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The saved entity.

bool $update: Specifies whether the entity is being updated or created.

Overrides EntityStorageBase::doPostSave

File

src/WebformEntityStorage.php, line 117

Class

WebformEntityStorage
Storage controller class for "webform" configuration entities.

Namespace

Drupal\webform

Code

protected function doPostSave(EntityInterface $entity, $update) {
  if ($update && $entity
    ->getAccessRules() !== $entity->original
    ->getAccessRules()) {

    // Invalidate webform_submission listing cache tags because due to the
    // change in access rules of this webform, some listings might have
    // changed for users.
    $cache_tags = $this->entityTypeManager
      ->getDefinition('webform_submission')
      ->getListCacheTags();
    Cache::invalidateTags($cache_tags);
  }
  parent::doPostSave($entity, $update);
}