interface ContextDefinitionInterface

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

Interface to define definition objects in ContextInterface via TypedData.

Hierarchy

Expanded class hierarchy of ContextDefinitionInterface

All classes that implement ContextDefinitionInterface

See also

\Drupal\Component\Plugin\Context\ContextDefinitionInterface

\Drupal\Core\Plugin\Context\ContextInterface

1 file declares its use of ContextDefinitionInterface
ContextualFiltersBlockContextTest.php in core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php

File

core/lib/Drupal/Core/Plugin/Context/ContextDefinitionInterface.php, line 13

Namespace

Drupal\Core\Plugin\Context
View source
interface ContextDefinitionInterface extends ComponentContextDefinitionInterface {
    
    /**
     * Returns the data definition of the defined context.
     *
     * @return \Drupal\Core\TypedData\DataDefinitionInterface
     *   The data definition object.
     */
    public function getDataDefinition();
    
    /**
     * Determines if this definition is satisfied by a context object.
     *
     * @param \Drupal\Core\Plugin\Context\ContextInterface $context
     *   The context object.
     *
     * @return bool
     *   TRUE if this definition is satisfiable by the context object, FALSE
     *   otherwise.
     */
    public function isSatisfiedBy(ContextInterface $context);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
ContextDefinitionInterface::addConstraint public function Adds a validation constraint. 1
ContextDefinitionInterface::getConstraint public function Gets a validation constraint. 1
ContextDefinitionInterface::getConstraints public function Gets an array of validation constraints. 1
ContextDefinitionInterface::getDataDefinition public function Returns the data definition of the defined context. 1
ContextDefinitionInterface::getDataType public function Gets the data type needed by the context. 1
ContextDefinitionInterface::getDefaultValue public function Gets the default value for this context definition. 1
ContextDefinitionInterface::getDescription public function Gets a human readable description. 1
ContextDefinitionInterface::getLabel public function Gets a human readable label. 1
ContextDefinitionInterface::isMultiple public function Determines whether the data is multi-valued, i.e. a list of data items. 1
ContextDefinitionInterface::isRequired public function Determines whether the context is required. 1
ContextDefinitionInterface::isSatisfiedBy public function Determines if this definition is satisfied by a context object. 1
ContextDefinitionInterface::setConstraints public function Sets the array of validation constraints. 1
ContextDefinitionInterface::setDataType public function Sets the data type needed by the context. 1
ContextDefinitionInterface::setDefaultValue public function Sets the default data value. 1
ContextDefinitionInterface::setDescription public function Sets the human readable description. 1
ContextDefinitionInterface::setLabel public function Sets the human readable label. 1
ContextDefinitionInterface::setMultiple public function Sets whether the data is multi-valued. 1
ContextDefinitionInterface::setRequired public function Sets whether the data is required. 1

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