Issn

Version: 2.4
Edit this page

Warning: You are browsing the documentation for Symfony 2.4, which is no longer maintained.

Read the updated version of this page for Symfony 6.0 (the current stable version).

Issn

New in version 2.3

The Issn constraint was introduced in Symfony 2.3.

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

Applies to property or method
Options
Class Issn
Validator IssnValidator

Basic Usage

  • YAML
  • Annotations
  • XML
  • PHP
1
2
3
4
5
# src/Acme/JournalBundle/Resources/config/validation.yml
Acme\JournalBundle\Entity\Journal:
    properties:
        issn:
            - Issn: ~

Options

message

type: String default: This value is not a valid ISSN.

The message shown if the given value is not a valid ISSN.

caseSensitive

type: Boolean default: false

The validator will allow ISSN values to end with a lower case 'x' by default. When switching this to true, the validator requires an upper case 'X'.

requireHyphen

type: Boolean default: false

The validator will allow non hyphenated ISSN values by default. When switching this to true, the validator requires a hyphenated ISSN value.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.