You are here

public function ContextDefinitionInterface::addConstraint in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/Component/Plugin/Context/ContextDefinitionInterface.php \Drupal\Component\Plugin\Context\ContextDefinitionInterface::addConstraint()

Adds a validation constraint.

Parameters

string $constraint_name: The name of the constraint to add, i.e. its plugin id.

array|null $options: The constraint options as required by the constraint plugin, or NULL.

Return value

$this

File

lib/Drupal/Component/Plugin/Context/ContextDefinitionInterface.php, line 165
Contains \Drupal\Component\Plugin\Context\ContextDefinitionInterface.

Class

ContextDefinitionInterface
Interface for context definitions.

Namespace

Drupal\Component\Plugin\Context

Code

public function addConstraint($constraint_name, $options = NULL);