code: public function validate($value, Constraint $constraint)
      {
          if ($value instanceof AutoPublishableInterface &&
              $value->getPublishDate() instanceof \DateTime &&
              $value->getUnpublishDate() instanceof \DateTime &&
              $value->getPublishDate()->getTimestamp() > $value->getUnpublishDate()->getTimestamp()
          ) {
              $this->context->buildViolation($constraint->message)
                  ->atPath('unpublishDate')
                  ->addViolation();
          }
      }
docs: Checks if the passed value is valid.
  
  @param AutoPublishableInterface $value The value that should be validated
  @param Constraint               $constraint The constraint for the validation