function LazyContextRepository::getAvailableContexts
Gets all available contexts for the purposes of configuration.
Return value
\Drupal\Core\Plugin\Context\ContextInterface[] All available contexts.
Overrides ContextRepositoryInterface::getAvailableContexts
File
- 
              core/lib/ Drupal/ Core/ Plugin/ Context/ LazyContextRepository.php, line 86 
Class
- LazyContextRepository
- Provides a context repository which uses context provider services.
Namespace
Drupal\Core\Plugin\ContextCode
public function getAvailableContexts() {
  $contexts = [];
  foreach ($this->contextProviderServiceIDs as $service_id) {
    $contexts_by_service = $this->container
      ->get($service_id)
      ->getAvailableContexts();
    foreach ($contexts_by_service as $unqualified_context_id => $context) {
      $context_id = '@' . $service_id . ':' . $unqualified_context_id;
      $contexts[$context_id] = $context;
    }
  }
  return $contexts;
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
