You are here

protected function ImageHotspotsController::disableCache in Image Hotspots 8

Invalidated cache items with current hotspot tag.

If user edit hotspots in one place it will displayed in other.

Parameters

array $target: Hotspot target.

4 calls to ImageHotspotsController::disableCache()
ImageHotspotsController::createAction in src/Controller/ImageHotspotsController.php
Creates hotspot with values from request data.
ImageHotspotsController::deleteAction in src/Controller/ImageHotspotsController.php
Deletes hotspot with $hid.
ImageHotspotsController::translateAction in src/Controller/ImageHotspotsController.php
Translate hotspot with $hid.
ImageHotspotsController::updateAction in src/Controller/ImageHotspotsController.php
Update hotspot with $hid.

File

src/Controller/ImageHotspotsController.php, line 243

Class

ImageHotspotsController
Class ImageHotspotsController.

Namespace

Drupal\image_hotspots\Controller

Code

protected function disableCache(array $target) {
  $tag = 'hotspots:' . $target['field_name'] . ':' . $target['fid'] . ':' . $target['image_style'];
  \Drupal::service('cache_tags.invalidator')
    ->invalidateTags([
    $tag,
  ]);
}