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

41 lines
936 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;
class Choice extends \Symfony\Component\Validator\Constraint
{
public $choices;
public $callback;
public $multiple = false;
public $min = null;
public $max = null;
public $message = 'This value should be one of the given choices';
public $minMessage = 'You should select at least {{ limit }} choices';
public $maxMessage = 'You should select at most {{ limit }} choices';
/**
* {@inheritDoc}
*/
public function getDefaultOption()
{
return 'choices';
}
/**
* {@inheritDoc}
*/
public function getTargets()
{
return self::PROPERTY_CONSTRAINT;
}
}