b1426cf4a90cd8bff5b35f89ae7799a68ae8e1e0
[yaffs-website] / vendor / symfony / validator / Tests / Mapping / Loader / constraint-mapping.xml
1 <?xml version="1.0" ?>
2
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">
6
7   <namespace prefix="custom">Symfony\Component\Validator\Tests\Fixtures\</namespace>
8
9   <class name="Symfony\Component\Validator\Tests\Fixtures\Entity">
10
11     <group-sequence>
12        <value>Foo</value>
13        <value>Entity</value>
14     </group-sequence>
15
16     <!-- CLASS CONSTRAINTS -->
17
18     <!-- Custom constraint -->
19     <constraint name="Symfony\Component\Validator\Tests\Fixtures\ConstraintA" />
20
21     <!-- Custom constraint with namespace abbreviation-->
22     <constraint name="custom:ConstraintB" />
23
24     <!-- Callbacks -->
25     <constraint name="Callback">validateMe</constraint>
26
27     <constraint name="Callback">validateMeStatic</constraint>
28
29     <constraint name="Callback">
30         <value>Symfony\Component\Validator\Tests\Fixtures\CallbackClass</value>
31         <value>callback</value>
32     </constraint>
33
34     <!-- Traverse with boolean default option -->
35     <constraint name="Traverse">
36         false
37     </constraint>
38
39     <!-- PROPERTY CONSTRAINTS -->
40
41     <property name="firstName">
42
43       <!-- Constraint without value -->
44       <constraint name="NotNull" />
45
46       <!-- Constraint with single value -->
47       <constraint name="Range">
48          <option name="min">3</option>
49       </constraint>
50
51       <!-- Constraint with multiple values -->
52       <constraint name="Choice">
53         <value>A</value>
54         <value>B</value>
55       </constraint>
56
57       <!-- Constraint with child constraints -->
58       <constraint name="All">
59         <constraint name="NotNull" />
60         <constraint name="Range">
61            <option name="min">3</option>
62         </constraint>
63
64       </constraint>
65
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>
72           </constraint>
73         </option>
74       </constraint>
75
76       <!-- Value with child constraints -->
77       <constraint name="Collection">
78         <option name="fields">
79           <value key="foo">
80             <constraint name="NotNull" />
81             <constraint name="Range">
82                <option name="min">3</option>
83             </constraint>
84           </value>
85           <value key="bar">
86             <constraint name="Range">
87                <option name="min">5</option>
88             </constraint>
89           </value>
90         </option>
91       </constraint>
92
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">
99           <value>A</value>
100           <value>B</value>
101         </option>
102       </constraint>
103     </property>
104
105     <!-- GETTER CONSTRAINTS -->
106
107     <getter property="lastName">
108       <constraint name="NotNull" />
109     </getter>
110     <getter property="valid">
111       <constraint name="IsTrue" />
112     </getter>
113     <getter property="permissions">
114       <constraint name="IsTrue" />
115     </getter>
116   </class>
117
118   <class name="Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity">
119
120     <!-- GROUP SEQUENCE PROVIDER -->
121     <group-sequence-provider />
122
123   </class>
124 </constraint-mapping>