symfony/symfony — pull request #4329 by odolbeau (2012-05-18 14:15:22+00:00)
Title: constraint_validation option can now be an array

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

It's now possible to pass an array of Constraint.

Here is a simple concret example:

```php
class NewPasswordType extends AbstractType
{
public function getDefaultOptions()
{
return array(
'type' => 'password',
'options' => array(
'required' => true,
),
'validation_constraint' => array(
new NotBlank(),
new MinLength(5)
),
);
}

public function getParent(array $options)
{
return 'repeated';
}
}
```