You are here

private function PathContext::setContextCacheByQueryNames in Acquia Lift Connector 8.3

Same name and namespace in other branches
  1. 8.4 src/Service/Context/PathContext.php \Drupal\acquia_lift\Service\Context\PathContext::setContextCacheByQueryNames()

Set Cache Context by query names.

@todo Add implements CacheContextInterface instead of brewing our own.

Parameters

array $query_names: The query names.

1 call to PathContext::setContextCacheByQueryNames()
PathContext::setContextIdentityByRequest in src/Service/Context/PathContext.php
Set Path Context Identity by request stack's query parameters.

File

src/Service/Context/PathContext.php, line 151

Class

PathContext

Namespace

Drupal\acquia_lift\Service\Context

Code

private function setContextCacheByQueryNames($query_names) {
  foreach ($query_names as $query_name) {
    if (empty($query_name)) {
      continue;
    }
    $this->cacheContexts[] = 'url.query_args:' . $query_name;
  }
}