34
34
35
35
.. code-block :: php-annotations
36
36
37
- // src/Acme/BlogBundle /Entity/Author.php
38
- namespace Acme\BlogBundle \Entity;
37
+ // src/AppBundle /Entity/Author.php
38
+ namespace AppBundle \Entity;
39
39
40
40
use Symfony\Component\Validator\Constraints as Assert;
41
41
@@ -48,21 +48,21 @@ Setup
48
48
49
49
.. code-block :: yaml
50
50
51
- # src/Acme/BlogBundle /Resources/config/validation.yml
52
- Acme\BlogBundle \Entity\Author :
51
+ # src/AppBundle /Resources/config/validation.yml
52
+ AppBundle \Entity\Author :
53
53
constraints :
54
54
- Callback :
55
55
methods : [isAuthorValid]
56
56
57
57
.. code-block :: xml
58
58
59
- <!-- src/Acme/BlogBundle /Resources/config/validation.xml -->
59
+ <!-- src/AppBundle /Resources/config/validation.xml -->
60
60
<?xml version =" 1.0" encoding =" UTF-8" ?>
61
61
<constraint-mapping xmlns =" http://symfony.com/schema/dic/constraint-mapping"
62
62
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
63
63
xsi : schemaLocation =" http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd" >
64
64
65
- <class name =" Acme\BlogBundle \Entity\Author" >
65
+ <class name =" AppBundle \Entity\Author" >
66
66
<constraint name =" Callback" >
67
67
<option name =" methods" >
68
68
<value >isAuthorValid</value >
73
73
74
74
.. code-block :: php
75
75
76
- // src/Acme/BlogBundle /Entity/Author.php
77
- namespace Acme\BlogBundle \Entity;
76
+ // src/AppBundle /Entity/Author.php
77
+ namespace AppBundle \Entity;
78
78
79
79
use Symfony\Component\Validator\Mapping\ClassMetadata;
80
80
use Symfony\Component\Validator\Constraints as Assert;
@@ -147,12 +147,12 @@ process. Each method can be one of the following formats:
147
147
148
148
.. code-block :: php-annotations
149
149
150
- // src/Acme/BlogBundle /Entity/Author.php
150
+ // src/AppBundle /Entity/Author.php
151
151
use Symfony\Component\Validator\Constraints as Assert;
152
152
153
153
/**
154
154
* @Assert\Callback(methods={
155
- * { "Acme\BlogBundle \MyStaticValidatorClass", "isAuthorValid" }
155
+ * { "AppBundle \MyStaticValidatorClass", "isAuthorValid" }
156
156
* })
157
157
*/
158
158
class Author
@@ -161,26 +161,26 @@ process. Each method can be one of the following formats:
161
161
162
162
.. code-block :: yaml
163
163
164
- # src/Acme/BlogBundle /Resources/config/validation.yml
165
- Acme\BlogBundle \Entity\Author :
164
+ # src/AppBundle /Resources/config/validation.yml
165
+ AppBundle \Entity\Author :
166
166
constraints :
167
167
- Callback :
168
168
methods :
169
- - [Acme\BlogBundle \MyStaticValidatorClass, isAuthorValid]
169
+ - [AppBundle \MyStaticValidatorClass, isAuthorValid]
170
170
171
171
.. code-block :: xml
172
172
173
- <!-- src/Acme/BlogBundle /Resources/config/validation.xml -->
173
+ <!-- src/AppBundle /Resources/config/validation.xml -->
174
174
<?xml version =" 1.0" encoding =" UTF-8" ?>
175
175
<constraint-mapping xmlns =" http://symfony.com/schema/dic/constraint-mapping"
176
176
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
177
177
xsi : schemaLocation =" http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd" >
178
178
179
- <class name =" Acme\BlogBundle \Entity\Author" >
179
+ <class name =" AppBundle \Entity\Author" >
180
180
<constraint name =" Callback" >
181
181
<option name =" methods" >
182
182
<value >
183
- <value >Acme\BlogBundle \MyStaticValidatorClass</value >
183
+ <value >AppBundle \MyStaticValidatorClass</value >
184
184
<value >isAuthorValid</value >
185
185
</value >
186
186
</option >
@@ -190,7 +190,7 @@ process. Each method can be one of the following formats:
190
190
191
191
.. code-block :: php
192
192
193
- // src/Acme/BlogBundle /Entity/Author.php
193
+ // src/AppBundle /Entity/Author.php
194
194
195
195
use Symfony\Component\Validator\Mapping\ClassMetadata;
196
196
use Symfony\Component\Validator\Constraints\Callback;
@@ -204,7 +204,7 @@ process. Each method can be one of the following formats:
204
204
$metadata->addConstraint(new Callback(array(
205
205
'methods' => array(
206
206
array(
207
- 'Acme\BlogBundle \MyStaticValidatorClass',
207
+ 'AppBundle \MyStaticValidatorClass',
208
208
'isAuthorValid',
209
209
),
210
210
),
@@ -213,14 +213,14 @@ process. Each method can be one of the following formats:
213
213
}
214
214
215
215
In this case, the static method ``isAuthorValid `` will be called on
216
- the ``Acme\BlogBundle \MyStaticValidatorClass `` class. It's passed both
216
+ the ``AppBundle \MyStaticValidatorClass `` class. It's passed both
217
217
the original object being validated (e.g. ``Author ``) as well as the
218
218
``ExecutionContextInterface ``::
219
219
220
- namespace Acme\BlogBundle ;
220
+ namespace AppBundle ;
221
221
222
222
use Symfony\Component\Validator\ExecutionContextInterface;
223
- use Acme\BlogBundle \Entity\Author;
223
+ use AppBundle \Entity\Author;
224
224
225
225
class MyStaticValidatorClass
226
226
{
0 commit comments