You are here

public function CartCacheContext::getContext in Commerce Core 8.2

Returns the string representation of the cache context.

A cache context service's name is used as a token (placeholder) cache key, and is then replaced with the string returned by this method.

Return value

string The string representation of the cache context.

Overrides CacheContextInterface::getContext

File

modules/cart/src/Cache/Context/CartCacheContext.php, line 54

Class

CartCacheContext
Defines the CartCacheContext service, for "per cart" caching.

Namespace

Drupal\commerce_cart\Cache\Context

Code

public function getContext() {
  return implode(':', $this->cartProvider
    ->getCartIds($this->account));
}