public function Context::validate in Zircon Profile 8
Same name in this branch
- 8 core/lib/Drupal/Core/Plugin/Context/Context.php \Drupal\Core\Plugin\Context\Context::validate()
- 8 core/lib/Drupal/Component/Plugin/Context/Context.php \Drupal\Component\Plugin\Context\Context::validate()
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Component/Plugin/Context/Context.php \Drupal\Component\Plugin\Context\Context::validate()
Validates the set context value.
Return value
\Symfony\Component\Validator\ConstraintViolationListInterface A list of constraint violations. If the list is empty, validation succeeded.
Overrides ContextInterface::validate
1 method overrides Context::validate()
- Context::validate in core/
lib/ Drupal/ Core/ Plugin/ Context/ Context.php - Validates the set context value.
File
- core/
lib/ Drupal/ Component/ Plugin/ Context/ Context.php, line 93 - Contains \Drupal\Component\Plugin\Context\Context.
Class
- Context
- A generic context class for wrapping data a plugin needs to operate.
Namespace
Drupal\Component\Plugin\ContextCode
public function validate() {
$validator = Validation::createValidatorBuilder()
->getValidator();
return $validator
->validateValue($this
->getContextValue(), $this
->getConstraints());
}