ContextAwarePluginManagerInterface.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerInterface.php
  2. 8.9.x core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerInterface.php
  3. 11.x core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerInterface.php

Namespace

Drupal\Core\Plugin\Context

File

core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerInterface.php

View source
<?php

namespace Drupal\Core\Plugin\Context;

use Drupal\Component\Plugin\PluginManagerInterface;

/**
 * Provides an interface for plugin managers that support context-aware plugins.
 */
interface ContextAwarePluginManagerInterface extends PluginManagerInterface {
    
    /**
     * Determines plugins whose constraints are satisfied by a set of contexts.
     *
     * @todo Use context definition objects after
     *   https://www.drupal.org/node/2281635.
     *
     * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
     *   An array of contexts.
     *
     * @return array
     *   An array of plugin definitions.
     *
     * @see \Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions()
     */
    public function getDefinitionsForContexts(array $contexts = []);

}

Interfaces

Title Deprecated Summary
ContextAwarePluginManagerInterface Provides an interface for plugin managers that support context-aware plugins.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.