You are here

public function TawkToCacheManager::getCacheContexts in Tawk.to - Live chat application (Drupal 8) 8

Same name and namespace in other branches
  1. 8.2 src/Cache/TawkToCacheManager.php \Drupal\tawk_to\Cache\TawkToCacheManager::getCacheContexts()

Gets cache tags based on the module settings and context plugins tags.

Return value

array The cache tags.

File

src/Cache/TawkToCacheManager.php, line 53

Class

TawkToCacheManager
Defines the cache manager tawk.to service.

Namespace

Drupal\tawk_to\Cache

Code

public function getCacheContexts() {
  $contexts = [
    'session',
  ];
  $conditions = $this->conditionsPluginsHandler
    ->getConditions();
  foreach ($conditions as $condition) {
    if ($condition instanceof CacheableDependencyInterface) {
      $contexts = array_merge($contexts, $condition
        ->getCacheContexts());
    }
  }
  return $contexts;
}