You are here

public function ConstraintViolationBuilder::setCode in Zircon Profile 8

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

Sets the violation code.

Parameters

int $code The violation code:

Return value

ConstraintViolationBuilderInterface This builder

Overrides ConstraintViolationBuilderInterface::setCode

File

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

Class

ConstraintViolationBuilder
Default implementation of {@link ConstraintViolationBuilderInterface}.

Namespace

Symfony\Component\Validator\Violation

Code

public function setCode($code) {
  $this->code = $code;
  return $this;
}