protected CacheContextsManager::getService($context_id)
Retrieves a cache context service from the container.
string $context_id: The context ID, which together with the service ID prefix allows the corresponding cache context service to be retrieved.
\Drupal\Core\Cache\Context\CacheContextInterface The requested cache context service.
protected function getService($context_id) { return $this->container->get('cache_context.' . $context_id); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Cache!Context!CacheContextsManager.php/function/CacheContextsManager::getService/8.1.x