3 namespace Drupal\Core\Display;
6 * Provides an interface for variant plugins that are context-aware.
8 interface ContextAwareVariantInterface extends VariantInterface {
11 * Gets the values for all defined contexts.
13 * @return \Drupal\Component\Plugin\Context\ContextInterface[]
14 * An array of set contexts, keyed by context name.
16 public function getContexts();
19 * Sets the context values for this display variant.
21 * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
22 * An array of contexts, keyed by context name.
26 public function setContexts(array $contexts);