3 namespace Drupal\Core\Plugin\Context;
6 * Offers a global context repository.
8 * Provides a list of all available contexts, which is mostly useful for
9 * configuration on forms, as well as a method to get the concrete contexts with
10 * their values, given a list of fully qualified context IDs.
12 * @see \Drupal\Core\Plugin\Context\ContextProviderInterface
14 interface ContextRepositoryInterface {
17 * Gets runtime context values for the given context IDs.
19 * Given that context providers might not return contexts for the given
20 * context IDs, it is also not guaranteed that the context repository returns
21 * contexts for all specified IDs.
23 * @param string[] $context_ids
24 * Fully qualified context IDs, which looks like
25 * @{service_id}:{unqualified_context_id}, so for example
26 * node.node_route_context:node.
28 * @return \Drupal\Core\Plugin\Context\ContextInterface[]
29 * The determined contexts, keyed by the fully qualified context ID.
31 public function getRuntimeContexts(array $context_ids);
34 * Gets all available contexts for the purposes of configuration.
36 * @return \Drupal\Core\Plugin\Context\ContextInterface[]
37 * All available contexts.
39 public function getAvailableContexts();