ContextAwareVariantInterface.php 675 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Drupal\Core\Display;
  3. /**
  4. * Provides an interface for variant plugins that are context-aware.
  5. */
  6. interface ContextAwareVariantInterface extends VariantInterface {
  7. /**
  8. * Gets the values for all defined contexts.
  9. *
  10. * @return \Drupal\Component\Plugin\Context\ContextInterface[]
  11. * An array of set contexts, keyed by context name.
  12. */
  13. public function getContexts();
  14. /**
  15. * Sets the context values for this display variant.
  16. *
  17. * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
  18. * An array of contexts, keyed by context name.
  19. *
  20. * @return $this
  21. */
  22. public function setContexts(array $contexts);
  23. }