1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?xml version="1.0" ?>
- <constraint-mapping xmlns="http://www.symfony-project.org/schema/dic/constraint-mapping"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.symfony-project.org/schema/dic/constraint-mapping http://www.symfony-project.org/schema/dic/services/constraint-mapping-1.0.xsd">
-
- <namespace prefix="custom">Symfony\Tests\Component\Validator\Fixtures\</namespace>
- <class name="Symfony\Tests\Component\Validator\Fixtures\Entity">
- <!-- CLASS CONSTRAINTS -->
- <!-- Custom constraint -->
- <constraint name="Symfony\Tests\Component\Validator\Fixtures\ConstraintA" />
- <!-- Custom constraint with namespace abbreviation-->
- <constraint name="custom:ConstraintB" />
- <!-- PROPERTY CONSTRAINTS -->
- <property name="firstName">
-
- <!-- Constraint without value -->
- <constraint name="NotNull" />
-
- <!-- Constraint with single value -->
- <constraint name="Min">3</constraint>
-
- <!-- Constraint with multiple values -->
- <constraint name="Choice">
- <value>A</value>
- <value>B</value>
- </constraint>
-
- <!-- Constraint with child constraints -->
- <constraint name="All">
- <constraint name="NotNull" />
- <constraint name="Min">3</constraint>
- </constraint>
-
- <!-- Option with child constraints -->
- <constraint name="All">
- <option name="constraints">
- <constraint name="NotNull" />
- <constraint name="Min">3</constraint>
- </option>
- </constraint>
-
- <!-- 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>
-
- <!-- 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>
- </constraint-mapping>
|