This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Validator/Constraints/Choice.php

38 lines
945 B
PHP
Raw Normal View History

<?php
/*
* This file is part of the Symfony package.
2010-10-02 11:42:31 +01:00
*
* (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.
*/
namespace Symfony\Component\Validator\Constraints;
2011-05-19 08:34:54 +01:00
use Symfony\Component\Validator\Constraint;
2011-06-30 11:03:19 +01:00
/** @Annotation */
2011-05-19 08:34:54 +01:00
class Choice extends Constraint
{
public $choices;
public $callback;
public $multiple = false;
public $strict = false;
public $min = null;
public $max = null;
public $message = 'The value you selected is not a valid choice';
public $multipleMessage = 'One or more of the given values is invalid';
public $minMessage = 'You must select at least {{ limit }} choices';
public $maxMessage = 'You must select at most {{ limit }} choices';
/**
* {@inheritDoc}
*/
public function getDefaultOption()
{
return 'choices';
}
}