public function ContextDefinitionInterface::setConstraints in Service Container 7.2
Same name and namespace in other branches
- 7 lib/Drupal/Component/Plugin/Context/ContextDefinitionInterface.php \Drupal\Component\Plugin\Context\ContextDefinitionInterface::setConstraints()
Sets the array of validation constraints.
NOTE: This will override any previously set constraints. In most cases ContextDefinitionInterface::addConstraint() should be used instead.
Parameters
array $constraints: The array of constraints.
Return value
$this
See also
File
- lib/
Drupal/ Component/ Plugin/ Context/ ContextDefinitionInterface.php, line 153 - Contains \Drupal\Component\Plugin\Context\ContextDefinitionInterface.
Class
- ContextDefinitionInterface
- Interface for context definitions.
Namespace
Drupal\Component\Plugin\ContextCode
public function setConstraints(array $constraints);