public function ExecutionContext::setConstraint

public ExecutionContext::setConstraint(Constraint $constraint)

Sets the currently validated constraint.

@internal Used by the validator engine. Should not be called by user code.

Parameters

Constraint $constraint The validated constraint:

Overrides ExecutionContextInterface::setConstraint

File

core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php, line 151

Class

ExecutionContext
Defines an execution context class.

Namespace

Drupal\Core\TypedData\Validation

Code

public function setConstraint(Constraint $constraint) {
  $this->constraint = $constraint;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!TypedData!Validation!ExecutionContext.php/function/ExecutionContext::setConstraint/8.1.x