ContextAwarePluginManagerInterface.php 787 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Drupal\Core\Plugin\Context;
  3. use Drupal\Component\Plugin\PluginManagerInterface;
  4. /**
  5. * Provides an interface for plugin managers that support context-aware plugins.
  6. */
  7. interface ContextAwarePluginManagerInterface extends PluginManagerInterface {
  8. /**
  9. * Determines plugins whose constraints are satisfied by a set of contexts.
  10. *
  11. * @todo Use context definition objects after
  12. * https://www.drupal.org/node/2281635.
  13. *
  14. * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
  15. * An array of contexts.
  16. *
  17. * @return array
  18. * An array of plugin definitions.
  19. *
  20. * @see \Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions()
  21. */
  22. public function getDefinitionsForContexts(array $contexts = []);
  23. }