2010-06-24 09:40:05 +01:00
|
|
|
<?xml version="1.0" ?>
|
|
|
|
|
2011-03-06 11:40:06 +00:00
|
|
|
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
|
2010-06-24 09:40:05 +01:00
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
2011-03-06 11:40:06 +00:00
|
|
|
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
|
2011-06-08 18:56:59 +01:00
|
|
|
|
2011-01-19 15:24:36 +00:00
|
|
|
<namespace prefix="custom">Symfony\Tests\Component\Validator\Fixtures\</namespace>
|
2010-06-24 09:40:05 +01:00
|
|
|
|
2010-08-20 22:09:55 +01:00
|
|
|
<class name="Symfony\Tests\Component\Validator\Fixtures\Entity">
|
2010-06-24 09:40:05 +01:00
|
|
|
|
2012-07-25 16:27:01 +01:00
|
|
|
<group-sequence>
|
|
|
|
<value>Foo</value>
|
|
|
|
<value>Entity</value>
|
|
|
|
</group-sequence>
|
|
|
|
|
2010-06-24 09:40:05 +01:00
|
|
|
<!-- CLASS CONSTRAINTS -->
|
|
|
|
|
2010-06-29 12:31:46 +01:00
|
|
|
<!-- Custom constraint -->
|
2010-08-20 22:09:55 +01:00
|
|
|
<constraint name="Symfony\Tests\Component\Validator\Fixtures\ConstraintA" />
|
2011-01-19 14:30:43 +00:00
|
|
|
|
2011-01-19 15:24:36 +00:00
|
|
|
<!-- Custom constraint with namespace abbreviation-->
|
|
|
|
<constraint name="custom:ConstraintB" />
|
|
|
|
|
2011-01-19 14:30:43 +00:00
|
|
|
<!-- PROPERTY CONSTRAINTS -->
|
|
|
|
|
|
|
|
<property name="firstName">
|
2011-06-08 18:56:59 +01:00
|
|
|
|
2011-01-19 14:30:43 +00:00
|
|
|
<!-- Constraint without value -->
|
2010-06-24 09:40:05 +01:00
|
|
|
<constraint name="NotNull" />
|
2011-06-08 18:56:59 +01:00
|
|
|
|
2011-01-19 14:30:43 +00:00
|
|
|
<!-- Constraint with single value -->
|
2010-06-24 09:40:05 +01:00
|
|
|
<constraint name="Min">3</constraint>
|
2011-06-08 18:56:59 +01:00
|
|
|
|
2011-01-19 14:30:43 +00:00
|
|
|
<!-- Constraint with multiple values -->
|
|
|
|
<constraint name="Choice">
|
|
|
|
<value>A</value>
|
|
|
|
<value>B</value>
|
|
|
|
</constraint>
|
2011-06-08 18:56:59 +01:00
|
|
|
|
2011-01-19 14:30:43 +00:00
|
|
|
<!-- Constraint with child constraints -->
|
|
|
|
<constraint name="All">
|
2010-06-24 09:40:05 +01:00
|
|
|
<constraint name="NotNull" />
|
|
|
|
<constraint name="Min">3</constraint>
|
2011-01-19 14:30:43 +00:00
|
|
|
</constraint>
|
2011-06-08 18:56:59 +01:00
|
|
|
|
2011-01-19 14:30:43 +00:00
|
|
|
<!-- Option with child constraints -->
|
|
|
|
<constraint name="All">
|
|
|
|
<option name="constraints">
|
2010-06-24 09:40:05 +01:00
|
|
|
<constraint name="NotNull" />
|
|
|
|
<constraint name="Min">3</constraint>
|
2011-01-19 14:30:43 +00:00
|
|
|
</option>
|
|
|
|
</constraint>
|
2011-06-08 18:56:59 +01:00
|
|
|
|
2011-01-19 14:30:43 +00:00
|
|
|
<!-- Value with child constraints -->
|
|
|
|
<constraint name="Collection">
|
|
|
|
<option name="fields">
|
|
|
|
<value key="foo">
|
|
|
|
<constraint name="NotNull" />
|
|
|
|
<constraint name="Min">3</constraint>
|
|
|
|
</value>
|
|
|
|
<value key="bar">
|
|
|
|
<constraint name="Min">5</constraint>
|
|
|
|
</value>
|
|
|
|
</option>
|
|
|
|
</constraint>
|
2011-06-08 18:56:59 +01:00
|
|
|
|
2010-06-24 09:40:05 +01:00
|
|
|
<!-- Constraint with options -->
|
|
|
|
<constraint name="Choice">
|
|
|
|
<!-- Option with single value -->
|
|
|
|
<option name="message">Must be one of %choices%</option>
|
|
|
|
<!-- Option with multiple values -->
|
|
|
|
<option name="choices">
|
|
|
|
<value>A</value>
|
|
|
|
<value>B</value>
|
|
|
|
</option>
|
|
|
|
</constraint>
|
|
|
|
</property>
|
|
|
|
|
|
|
|
<!-- GETTER CONSTRAINTS -->
|
|
|
|
|
|
|
|
<getter property="lastName">
|
|
|
|
<constraint name="NotNull" />
|
|
|
|
</getter>
|
|
|
|
</class>
|
2011-06-08 18:56:59 +01:00
|
|
|
</constraint-mapping>
|