You are here

protected function IsbnValidator::getMessage in Plug 7

File

lib/Symfony/validator/Symfony/Component/Validator/Constraints/IsbnValidator.php, line 180

Class

IsbnValidator
Validates whether the value is a valid ISBN-10 or ISBN-13

Namespace

Symfony\Component\Validator\Constraints

Code

protected function getMessage($constraint, $type = null) {
  if (null !== $constraint->message) {
    return $constraint->message;
  }
  elseif ('isbn10' === $type) {
    return $constraint->isbn10Message;
  }
  elseif ('isbn13' === $type) {
    return $constraint->isbn13Message;
  }
  return $constraint->bothIsbnMessage;
}