Symfony\Component\Validator\ConstraintViolationList::set PHP Method

set() public method

Sets a violation at a given offset.
public set ( integer $offset, ConstraintViolation $violation )
$offset integer The violation offset.
$violation ConstraintViolation The violation.
    public function set($offset, ConstraintViolation $violation)
    {
        $this->violations[$offset] = $violation;
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function set($offset, ConstraintViolationInterface $violation)
 {
     parent::set($offset, $violation);
     $this->violationOffsetsByField = NULL;
     $this->entityViolationOffsets = NULL;
 }