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

44 lines
1.1 KiB
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;
use Symfony\Component\Validator\Constraint;
2011-07-20 09:37:57 +01:00
/**
* @Annotation
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
2011-07-20 09:37:57 +01:00
* @api
*/
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 }} choice.|You must select at least {{ limit }} choices.';
public $maxMessage = 'You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.';
/**
* {@inheritdoc}
*/
public function getDefaultOption()
{
return 'choices';
}
}