You are here

public function SocialTourController::getCacheTags in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::getCacheTags()
  2. 8.6 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::getCacheTags()
  3. 8.7 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::getCacheTags()
  4. 8.8 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::getCacheTags()
  5. 10.0.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::getCacheTags()
  6. 10.1.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::getCacheTags()
  7. 10.2.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::getCacheTags()

Returns tags based on tours of page.

Parameters

string $route_name: A route name.

Return value

array The cache tags.

1 call to SocialTourController::getCacheTags()
SocialTourController::disableOnboarding in modules/custom/social_tour/src/SocialTourController.php
Disable onboarding for current_user by Ajax call.

File

modules/custom/social_tour/src/SocialTourController.php, line 191

Class

SocialTourController
Class SocialTourController.

Namespace

Drupal\social_tour

Code

public function getCacheTags($route_name) {
  $tours = $this->entityTypeManager
    ->getStorage('tour')
    ->getQuery()
    ->condition('routes.*.route_name', $route_name)
    ->execute();
  return array_map(function ($tour) {
    return 'user:' . $this->currentUser
      ->id() . ':tour:' . $tour;
  }, $tours);
}