| 1 | <?php |
||
| 14 | final class Isbn extends AbstractConstraint |
||
| 15 | { |
||
| 16 | public $message = 'This value is not a valid ISBN.'; |
||
| 17 | public $type = null; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * {@inheritdoc} |
||
| 21 | */ |
||
| 22 | public function __construct($options = null) |
||
| 23 | { |
||
| 24 | parent::__construct($options); |
||
| 25 | |||
| 26 | if ($this->type !== null && !in_array($this->type, [10, 13])) { |
||
| 27 | throw new ConstraintDefinitionException('The option "type" must be 10 or 13'); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | public function getDefaultOption() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * {@inheritdoc} |
||
| 41 | */ |
||
| 42 | public function getIsoCodesVersion() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritdoc} |
||
| 49 | */ |
||
| 50 | public function getIsoCodesClass() |
||
| 54 | } |
||
| 55 |