You are here

public function ConstraintViolationBuilder::setCause in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/Violation/ConstraintViolationBuilder.php \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setCause()
  2. 8 core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php \Drupal\Core\TypedData\Validation\ConstraintViolationBuilder::setCause()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Violation/ConstraintViolationBuilder.php \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setCause()

Sets the cause of the violation.

Parameters

mixed $cause The cause of the violation:

Return value

ConstraintViolationBuilderInterface This builder

Overrides ConstraintViolationBuilderInterface::setCause

File

vendor/symfony/validator/Violation/ConstraintViolationBuilder.php, line 178

Class

ConstraintViolationBuilder
Default implementation of {@link ConstraintViolationBuilderInterface}.

Namespace

Symfony\Component\Validator\Violation

Code

public function setCause($cause) {
  $this->cause = $cause;
  return $this;
}