function ContextDefinition::addConstraint
Same name in other branches
- 9 core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php \Drupal\Core\Plugin\Context\ContextDefinition::addConstraint()
- 8.9.x core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php \Drupal\Core\Plugin\Context\ContextDefinition::addConstraint()
- 11.x core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php \Drupal\Core\Plugin\Context\ContextDefinition::addConstraint()
Overrides ContextDefinitionInterface::addConstraint
2 calls to ContextDefinition::addConstraint()
- ContextDefinition::__construct in core/
lib/ Drupal/ Core/ Plugin/ Context/ ContextDefinition.php - Constructs a new context definition object.
- EntityContextDefinition::getConstraintObjects in core/
lib/ Drupal/ Core/ Plugin/ Context/ EntityContextDefinition.php - Extracts an array of constraints for a context definition object.
File
-
core/
lib/ Drupal/ Core/ Plugin/ Context/ ContextDefinition.php, line 239
Class
- ContextDefinition
- Defines a class for context definitions.
Namespace
Drupal\Core\Plugin\ContextCode
public function addConstraint($constraint_name, $options = NULL) {
$this->constraints[$constraint_name] = $options;
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.