Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /*
|
Chris@0
|
4 * This file is part of the Symfony package.
|
Chris@0
|
5 *
|
Chris@0
|
6 * (c) Fabien Potencier <fabien@symfony.com>
|
Chris@0
|
7 *
|
Chris@0
|
8 * For the full copyright and license information, please view the LICENSE
|
Chris@0
|
9 * file that was distributed with this source code.
|
Chris@0
|
10 */
|
Chris@0
|
11
|
Chris@0
|
12 namespace Symfony\Component\Validator\Constraints;
|
Chris@0
|
13
|
Chris@0
|
14 use Symfony\Component\Validator\Constraint;
|
Chris@0
|
15
|
Chris@0
|
16 /**
|
Chris@0
|
17 * @Annotation
|
Chris@0
|
18 * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
|
Chris@0
|
19 *
|
Chris@0
|
20 * @author Antonio J. GarcĂa Lagar <aj@garcialagar.es>
|
Chris@0
|
21 * @author Bernhard Schussek <bschussek@gmail.com>
|
Chris@0
|
22 */
|
Chris@0
|
23 class Issn extends Constraint
|
Chris@0
|
24 {
|
Chris@0
|
25 const TOO_SHORT_ERROR = '6a20dd3d-f463-4460-8e7b-18a1b98abbfb';
|
Chris@0
|
26 const TOO_LONG_ERROR = '37cef893-5871-464e-8b12-7fb79324833c';
|
Chris@0
|
27 const MISSING_HYPHEN_ERROR = '2983286f-8134-4693-957a-1ec4ef887b15';
|
Chris@0
|
28 const INVALID_CHARACTERS_ERROR = 'a663d266-37c2-4ece-a914-ae891940c588';
|
Chris@0
|
29 const INVALID_CASE_ERROR = '7b6dd393-7523-4a6c-b84d-72b91bba5e1a';
|
Chris@0
|
30 const CHECKSUM_FAILED_ERROR = 'b0f92dbc-667c-48de-b526-ad9586d43e85';
|
Chris@0
|
31
|
Chris@17
|
32 protected static $errorNames = [
|
Chris@0
|
33 self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR',
|
Chris@0
|
34 self::TOO_LONG_ERROR => 'TOO_LONG_ERROR',
|
Chris@0
|
35 self::MISSING_HYPHEN_ERROR => 'MISSING_HYPHEN_ERROR',
|
Chris@0
|
36 self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR',
|
Chris@0
|
37 self::INVALID_CASE_ERROR => 'INVALID_CASE_ERROR',
|
Chris@0
|
38 self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR',
|
Chris@17
|
39 ];
|
Chris@0
|
40
|
Chris@0
|
41 public $message = 'This value is not a valid ISSN.';
|
Chris@0
|
42 public $caseSensitive = false;
|
Chris@0
|
43 public $requireHyphen = false;
|
Chris@0
|
44 }
|