/**
  * @param StaticSegment $value
  * @param UniqueStaticSegmentNameConstraint|Constraint $constraint
  */
 public function validate($value, Constraint $constraint)
 {
     if ($value instanceof StaticSegment && !$value->getOriginId()) {
         $this->transport->init($value->getChannel()->getTransport());
         $segments = $this->transport->getListStaticSegments($value->getSubscribersList());
         foreach ($segments as $segment) {
             if ($segment['name'] == $value->getName()) {
                 $this->context->addViolationAt('name', $constraint->message);
                 break;
             }
         }
     }
 }