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

Breadcrumb

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

class Issn

Validates that a value is a valid International Standard Serial Number (ISSN).

@author Antonio J. GarcĂ­a Lagar <aj@garcialagar.es> @author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

  • class \Symfony\Component\Validator\Constraint
    • class \Symfony\Component\Validator\Constraints\Issn extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of Issn

See also

https://en.wikipedia.org/wiki/ISSN

File

vendor/symfony/validator/Constraints/Issn.php, line 24

Namespace

Symfony\Component\Validator\Constraints
View source
class Issn extends Constraint {
    public const TOO_SHORT_ERROR = '6a20dd3d-f463-4460-8e7b-18a1b98abbfb';
    public const TOO_LONG_ERROR = '37cef893-5871-464e-8b12-7fb79324833c';
    public const MISSING_HYPHEN_ERROR = '2983286f-8134-4693-957a-1ec4ef887b15';
    public const INVALID_CHARACTERS_ERROR = 'a663d266-37c2-4ece-a914-ae891940c588';
    public const INVALID_CASE_ERROR = '7b6dd393-7523-4a6c-b84d-72b91bba5e1a';
    public const CHECKSUM_FAILED_ERROR = 'b0f92dbc-667c-48de-b526-ad9586d43e85';
    protected const ERROR_NAMES = [
        self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR',
        self::TOO_LONG_ERROR => 'TOO_LONG_ERROR',
        self::MISSING_HYPHEN_ERROR => 'MISSING_HYPHEN_ERROR',
        self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR',
        self::INVALID_CASE_ERROR => 'INVALID_CASE_ERROR',
        self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR',
    ];
    public string $message = 'This value is not a valid ISSN.';
    public bool $caseSensitive = false;
    public bool $requireHyphen = false;
    
    /**
     * @param array<string,mixed>|null $options
     * @param bool|null                $caseSensitive Whether to allow the value to end with a lowercase character (defaults to false)
     * @param bool|null                $requireHyphen Whether to require a hyphenated ISSN value (defaults to false)
     * @param string[]|null            $groups
     */
    public function __construct(?array $options = null, ?string $message = null, ?bool $caseSensitive = null, ?bool $requireHyphen = null, ?array $groups = null, mixed $payload = null) {
        parent::__construct($options, $groups, $payload);
        $this->message = $message ?? $this->message;
        $this->caseSensitive = $caseSensitive ?? $this->caseSensitive;
        $this->requireHyphen = $requireHyphen ?? $this->requireHyphen;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Constraint::$groups public property The groups that the constraint belongs to.
Constraint::$payload public property Domain-specific data attached to a constraint.
Constraint::addImplicitGroupName public function Adds the given group if this constraint is in the Default group. 2
Constraint::CLASS_CONSTRAINT public constant Marks a constraint that can be put onto classes.
Constraint::DEFAULT_GROUP public constant The name of the group given to all constraints with no explicit group.
Constraint::getDefaultOption public function Returns the name of the default option. 28
Constraint::getErrorName public static function Returns the name of the given error code.
Constraint::getRequiredOptions public function Returns the name of the required options. 22
Constraint::getTargets public function Returns whether the constraint can be put onto classes, properties or
both.
8
Constraint::normalizeOptions protected function
Constraint::PROPERTY_CONSTRAINT public constant Marks a constraint that can be put onto properties.
Constraint::validatedBy public function Returns the name of the class that validates this constraint. 9
Constraint::__get public function Returns the value of a lazily initialized option. 2
Constraint::__isset public function 1
Constraint::__set public function Sets the value of a lazily initialized option. 1
Constraint::__sleep public function Optimizes the serialized value to minimize storage space.
Issn::$caseSensitive public property
Issn::$message public property
Issn::$requireHyphen public property
Issn::CHECKSUM_FAILED_ERROR public constant
Issn::ERROR_NAMES protected constant Maps error codes to the names of their constants. Overrides Constraint::ERROR_NAMES
Issn::INVALID_CASE_ERROR public constant
Issn::INVALID_CHARACTERS_ERROR public constant
Issn::MISSING_HYPHEN_ERROR public constant
Issn::TOO_LONG_ERROR public constant
Issn::TOO_SHORT_ERROR public constant
Issn::__construct public function Overrides Constraint::__construct
RSS feed
Powered by Drupal