class TawkToCacheManager in Tawk.to - Live chat application (Drupal 8) 8.2
Same name and namespace in other branches
- 8 src/Cache/TawkToCacheManager.php \Drupal\tawk_to\Cache\TawkToCacheManager
Defines the cache manager tawk.to service.
Hierarchy
- class \Drupal\tawk_to\Cache\TawkToCacheManager
Expanded class hierarchy of TawkToCacheManager
1 file declares its use of TawkToCacheManager
- TawkToEmbedRender.php in src/
Service/ TawkToEmbedRender.php
1 string reference to 'TawkToCacheManager'
1 service uses TawkToCacheManager
File
- src/
Cache/ TawkToCacheManager.php, line 11
Namespace
Drupal\tawk_to\CacheView source
class TawkToCacheManager {
/**
* The condition plugin defination.
*
* @var \Drupal\tawk_to\Service\TawkToConditionPluginsHandler
*/
protected $conditionsPluginsHandler;
/**
* Constructs the TawkToCacheManager.
*
* @param Drupal\tawk_to\Service\TawkToConditionPluginsHandler $conditionsPluginsHandler
* The tawk.to access controller handler.
*/
public function __construct(TawkToConditionPluginsHandler $conditionsPluginsHandler) {
$this->conditionsPluginsHandler = $conditionsPluginsHandler;
}
/**
* Gets cache tags based on the module settings and context plugins tags.
*
* @return array
* The cache tags.
*/
public function getCacheTags() {
$tags = [
'config:tawk_to.settings',
];
$conditions = $this->conditionsPluginsHandler
->getConditions();
foreach ($conditions as $condition) {
if ($condition instanceof CacheableDependencyInterface) {
$tags = array_merge($tags, $condition
->getCacheTags());
}
}
return $tags;
}
/**
* Gets cache tags based on the module settings and context plugins tags.
*
* @return array
* The cache tags.
*/
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TawkToCacheManager:: |
protected | property | The condition plugin defination. | |
TawkToCacheManager:: |
public | function | Gets cache tags based on the module settings and context plugins tags. | |
TawkToCacheManager:: |
public | function | Gets cache tags based on the module settings and context plugins tags. | |
TawkToCacheManager:: |
public | function | Constructs the TawkToCacheManager. |