You are here

public function ConstraintViolationBuilder::setCode in Plug 7

Sets the violation code.

Parameters

int $code The violation code:

Return value

ConstraintViolationBuilderInterface This builder

Overrides ConstraintViolationBuilderInterface::setCode

File

lib/Symfony/validator/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php, line 167

Class

ConstraintViolationBuilder
Default implementation of {@link ConstraintViolationBuilderInterface}.

Namespace

Symfony\Component\Validator\Violation

Code

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