You are here

protected function IsbnValidator::getMessage in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Constraints/IsbnValidator.php \Symfony\Component\Validator\Constraints\IsbnValidator::getMessage()

File

vendor/symfony/validator/Constraints/IsbnValidator.php, line 204

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;
}