2013-01-12 13:38:26 +00:00
|
|
|
<?php
|
2013-04-20 14:37:23 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the Symfony package.
|
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
2013-01-12 13:38:26 +00:00
|
|
|
|
|
|
|
namespace Symfony\Component\Validator\Constraints;
|
|
|
|
|
|
|
|
use Symfony\Component\Validator\Constraint;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Annotation
|
2014-04-23 11:57:22 +01:00
|
|
|
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
|
2013-04-20 14:37:23 +01:00
|
|
|
*
|
2013-01-12 13:38:26 +00:00
|
|
|
* @author The Whole Life To Learn <thewholelifetolearn@gmail.com>
|
2014-03-27 06:27:38 +00:00
|
|
|
* @author Manuel Reinhard <manu@sprain.ch>
|
2013-01-12 13:38:26 +00:00
|
|
|
*/
|
|
|
|
class Isbn extends Constraint
|
|
|
|
{
|
|
|
|
public $isbn10Message = 'This value is not a valid ISBN-10.';
|
|
|
|
public $isbn13Message = 'This value is not a valid ISBN-13.';
|
|
|
|
public $bothIsbnMessage = 'This value is neither a valid ISBN-10 nor a valid ISBN-13.';
|
2014-03-27 06:27:38 +00:00
|
|
|
public $type;
|
|
|
|
public $message;
|
2013-04-20 14:37:23 +01:00
|
|
|
|
2014-03-27 06:27:38 +00:00
|
|
|
/**
|
|
|
|
* @deprecated Deprecated since version 2.5, to be removed in 3.0. Use option "type" instead.
|
2014-04-16 11:36:34 +01:00
|
|
|
* @var bool
|
2014-03-27 06:27:38 +00:00
|
|
|
*/
|
|
|
|
public $isbn10 = false;
|
2013-04-20 14:37:23 +01:00
|
|
|
|
2014-03-27 06:27:38 +00:00
|
|
|
/**
|
|
|
|
* @deprecated Deprecated since version 2.5, to be removed in 3.0. Use option "type" instead.
|
2014-04-16 11:36:34 +01:00
|
|
|
* @var bool
|
2014-03-27 06:27:38 +00:00
|
|
|
*/
|
|
|
|
public $isbn13 = false;
|
2013-04-20 14:37:23 +01:00
|
|
|
|
2014-03-27 06:27:38 +00:00
|
|
|
/**
|
2014-04-16 09:09:16 +01:00
|
|
|
* {@inheritdoc}
|
2014-03-27 06:27:38 +00:00
|
|
|
*/
|
|
|
|
public function getDefaultOption()
|
|
|
|
{
|
|
|
|
return 'type';
|
2013-01-12 13:38:26 +00:00
|
|
|
}
|
2013-04-20 14:37:23 +01:00
|
|
|
}
|