ContextAwarePluginInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Drupal\Core\Plugin;
  3. use Drupal\Component\Plugin\ContextAwarePluginInterface as ComponentContextAwarePluginInterface;
  4. /**
  5. * An override of ContextAwarePluginInterface for documentation purposes.
  6. *
  7. * @see \Drupal\Component\Plugin\ContextAwarePluginInterface
  8. *
  9. * @ingroup plugin_api
  10. */
  11. interface ContextAwarePluginInterface extends ComponentContextAwarePluginInterface {
  12. /**
  13. * Gets the context definitions of the plugin.
  14. *
  15. * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface[]
  16. * The array of context definitions, keyed by context name.
  17. */
  18. public function getContextDefinitions();
  19. /**
  20. * Gets a specific context definition of the plugin.
  21. *
  22. * @param string $name
  23. * The name of the context in the plugin definition.
  24. *
  25. * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface
  26. * The definition against which the context value must validate.
  27. *
  28. * @throws \Drupal\Component\Plugin\Exception\PluginException
  29. * If the requested context is not defined.
  30. */
  31. public function getContextDefinition($name);
  32. }