/**
  * @param Violation $violation violation
  */
 public function add(Violation $violation)
 {
     $violation->setSubjectModel($this->subjectModel);
     $violation->setSubjectId($this->subjectId);
     $violation->setFixed(false);
     if (!$violation->getId() && false !== ($key = $this->contains($violation))) {
         $this->violations[$key]->setFixed(false);
         return;
     }
     $this->violations[] = $violation;
 }
 /**
  * @param $subjectModel string
  * @param $subjectId integer
  * @param $subjectProperty string
  * @param $code integer
  * @param $message string
  * @param $messageParameters array
  * @param $isFixed boolean
  * @param $createdAt \DateTime
  * @return Violation
  */
 private function generateViolation($subjectModel, $subjectId, $subjectProperty, $code, $message, array $messageParameters, $isFixed, \DateTime $createdAt)
 {
     $violation = new TestedClass();
     $violation->setSubjectModel($subjectModel);
     $violation->setSubjectId($subjectId);
     $violation->setSubjectProperty($subjectProperty);
     $violation->setCode($code);
     $violation->setMessage($message);
     $violation->setMessageParameters($messageParameters);
     $violation->setFixed($isFixed);
     $violation->setCreatedAt($createdAt);
     return $violation;
 }