You are here

protected function VoteController::invalidateCacheTags in Rate 8

Invalidate cache tags to update vote display.

Parameters

string $entity_type_id: The entity type.

int $entity_id: The entity id.

string $bundle: The bundle name.

2 calls to VoteController::invalidateCacheTags()
VoteController::undoVote in src/Controller/VoteController.php
Undo a vote.
VoteController::vote in src/Controller/VoteController.php
Record a vote.

File

src/Controller/VoteController.php, line 120

Class

VoteController
Returns responses for Rate routes.

Namespace

Drupal\rate\Controller

Code

protected function invalidateCacheTags($entity_type_id, $entity_id, $bundle) {
  $invalidate_tags = [
    $entity_type_id . ':' . $entity_id,
    'vote:' . $bundle . ':' . $entity_id,
  ];
  $this->cacheTagsInvalidator
    ->invalidateTags($invalidate_tags);
}