@@ -35,8 +35,8 @@ Configuration
35
35
36
36
.. code-block :: php-annotations
37
37
38
- // src/AppBundle/ Entity/Author.php
39
- namespace AppBundle \Entity;
38
+ // src/Entity/Author.php
39
+ namespace App \Entity;
40
40
41
41
use Symfony\Component\Validator\Constraints as Assert;
42
42
use Symfony\Component\Validator\Context\ExecutionContextInterface;
@@ -54,28 +54,28 @@ Configuration
54
54
55
55
.. code-block :: yaml
56
56
57
- # src/AppBundle/ Resources/config/validation.yml
58
- AppBundle \Entity\Author :
57
+ # src/Resources/config/validation.yml
58
+ App \Entity\Author :
59
59
constraints :
60
60
- Callback : validate
61
61
62
62
.. code-block :: xml
63
63
64
- <!-- src/AppBundle/ Resources/config/validation.xml -->
64
+ <!-- src/Resources/config/validation.xml -->
65
65
<?xml version =" 1.0" encoding =" UTF-8" ?>
66
66
<constraint-mapping xmlns =" http://symfony.com/schema/dic/constraint-mapping"
67
67
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
68
68
xsi : schemaLocation =" http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd" >
69
69
70
- <class name =" AppBundle \Entity\Author" >
70
+ <class name =" App \Entity\Author" >
71
71
<constraint name =" Callback" >validate</constraint >
72
72
</class >
73
73
</constraint-mapping >
74
74
75
75
.. code-block :: php
76
76
77
- // src/AppBundle/ Entity/Author.php
78
- namespace AppBundle \Entity;
77
+ // src/Entity/Author.php
78
+ namespace App \Entity;
79
79
80
80
use Symfony\Component\Validator\Mapping\ClassMetadata;
81
81
use Symfony\Component\Validator\Constraints as Assert;
@@ -163,8 +163,8 @@ You can then use the following configuration to invoke this validator:
163
163
164
164
.. code-block :: php-annotations
165
165
166
- // src/AppBundle/ Entity/Author.php
167
- namespace AppBundle \Entity;
166
+ // src/Entity/Author.php
167
+ namespace App \Entity;
168
168
169
169
use Symfony\Component\Validator\Constraints as Assert;
170
170
@@ -177,20 +177,20 @@ You can then use the following configuration to invoke this validator:
177
177
178
178
.. code-block :: yaml
179
179
180
- # src/AppBundle/ Resources/config/validation.yml
181
- AppBundle \Entity\Author :
180
+ # src/Resources/config/validation.yml
181
+ App \Entity\Author :
182
182
constraints :
183
183
- Callback : [Acme\Validator, validate]
184
184
185
185
.. code-block :: xml
186
186
187
- <!-- src/AppBundle/ Resources/config/validation.xml -->
187
+ <!-- src/Resources/config/validation.xml -->
188
188
<?xml version =" 1.0" encoding =" UTF-8" ?>
189
189
<constraint-mapping xmlns =" http://symfony.com/schema/dic/constraint-mapping"
190
190
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
191
191
xsi : schemaLocation =" http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd" >
192
192
193
- <class name =" AppBundle \Entity\Author" >
193
+ <class name =" App \Entity\Author" >
194
194
<constraint name =" Callback" >
195
195
<value >Acme\Validator</value >
196
196
<value >validate</value >
@@ -200,8 +200,8 @@ You can then use the following configuration to invoke this validator:
200
200
201
201
.. code-block :: php
202
202
203
- // src/AppBundle/ Entity/Author.php
204
- namespace AppBundle \Entity;
203
+ // src/Entity/Author.php
204
+ namespace App \Entity;
205
205
206
206
use Acme\Validator;
207
207
use Symfony\Component\Validator\Mapping\ClassMetadata;
@@ -229,8 +229,8 @@ You can then use the following configuration to invoke this validator:
229
229
When configuring the constraint via PHP, you can also pass a closure to the
230
230
constructor of the Callback constraint::
231
231
232
- // src/AppBundle/ Entity/Author.php
233
- namespace AppBundle \Entity;
232
+ // src/Entity/Author.php
233
+ namespace App \Entity;
234
234
235
235
use Symfony\Component\Validator\Context\ExecutionContextInterface;
236
236
0 commit comments