ContextAwarePluginManagerInterface.php 695 B

1234567891011121314151617181920212223242526
  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. public function getDefinitionsForContexts(array $contexts = []);
  21. }