Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. IsbnValidator.php

function IsbnValidator::getMessage

File

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

Class

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

Namespace

Symfony\Component\Validator\Constraints

Code

protected function getMessage(Isbn $constraint, ?string $type = null) : string {
    if (null !== $constraint->message) {
        return $constraint->message;
    }
    elseif (Isbn::ISBN_10 === $type) {
        return $constraint->isbn10Message;
    }
    elseif (Isbn::ISBN_13 === $type) {
        return $constraint->isbn13Message;
    }
    return $constraint->bothIsbnMessage;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal