ContextAwarePluginInterface.php

Same filename in this branch
  1. 10 core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php
Same filename in other branches
  1. 9 core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php
  2. 9 core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php
  3. 8.9.x core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php
  4. 8.9.x core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php
  5. 11.x core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php
  6. 11.x core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php

Namespace

Drupal\Core\Plugin

File

core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php

View source
<?php

namespace Drupal\Core\Plugin;

use Drupal\Component\Plugin\ContextAwarePluginInterface as ComponentContextAwarePluginInterface;

/**
 * An override of ContextAwarePluginInterface for documentation purposes.
 *
 * @see \Drupal\Component\Plugin\ContextAwarePluginInterface
 * @see \Drupal\Core\Plugin\ContextAwarePluginTrait
 *
 * @ingroup plugin_api
 */
interface ContextAwarePluginInterface extends ComponentContextAwarePluginInterface {
    
    /**
     * Gets the context definitions of the plugin.
     *
     * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface[]
     *   The array of context definitions, keyed by context name.
     */
    public function getContextDefinitions();
    
    /**
     * Gets a specific context definition of the plugin.
     *
     * @param string $name
     *   The name of the context in the plugin definition.
     *
     * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface
     *   The definition against which the context value must validate.
     *
     * @throws \Drupal\Component\Plugin\Exception\ContextException
     *   If the requested context is not defined.
     */
    public function getContextDefinition($name);

}

Interfaces

Title Deprecated Summary
ContextAwarePluginInterface An override of ContextAwarePluginInterface for documentation purposes.

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