3 <constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5 xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
7 <namespace prefix="custom">Symfony\Component\Validator\Tests\Fixtures\</namespace>
9 <class name="Symfony\Component\Validator\Tests\Fixtures\Entity">
16 <!-- CLASS CONSTRAINTS -->
18 <!-- Custom constraint -->
19 <constraint name="Symfony\Component\Validator\Tests\Fixtures\ConstraintA" />
21 <!-- Custom constraint with namespace abbreviation-->
22 <constraint name="custom:ConstraintB" />
25 <constraint name="Callback">validateMe</constraint>
27 <constraint name="Callback">validateMeStatic</constraint>
29 <constraint name="Callback">
30 <value>Symfony\Component\Validator\Tests\Fixtures\CallbackClass</value>
31 <value>callback</value>
34 <!-- Traverse with boolean default option -->
35 <constraint name="Traverse">
39 <!-- PROPERTY CONSTRAINTS -->
41 <property name="firstName">
43 <!-- Constraint without value -->
44 <constraint name="NotNull" />
46 <!-- Constraint with single value -->
47 <constraint name="Range">
48 <option name="min">3</option>
51 <!-- Constraint with multiple values -->
52 <constraint name="Choice">
57 <!-- Constraint with child constraints -->
58 <constraint name="All">
59 <constraint name="NotNull" />
60 <constraint name="Range">
61 <option name="min">3</option>
66 <!-- Option with child constraints -->
67 <constraint name="All">
68 <option name="constraints">
69 <constraint name="NotNull" />
70 <constraint name="Range">
71 <option name="min">3</option>
76 <!-- Value with child constraints -->
77 <constraint name="Collection">
78 <option name="fields">
80 <constraint name="NotNull" />
81 <constraint name="Range">
82 <option name="min">3</option>
86 <constraint name="Range">
87 <option name="min">5</option>
93 <!-- Constraint with options -->
94 <constraint name="Choice">
95 <!-- Option with single value -->
96 <option name="message"> Must be one of %choices% </option>
97 <!-- Option with multiple values -->
98 <option name="choices">
105 <!-- GETTER CONSTRAINTS -->
107 <getter property="lastName">
108 <constraint name="NotNull" />
110 <getter property="valid">
111 <constraint name="IsTrue" />
113 <getter property="permissions">
114 <constraint name="IsTrue" />
118 <class name="Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity">
120 <!-- GROUP SEQUENCE PROVIDER -->
121 <group-sequence-provider />
124 </constraint-mapping>