@@ -207,8 +207,8 @@ constraint.
207207 }
208208 }
209209
210- If the static callback is stored in a different class, for example ``Util ``,
211- you can pass theclass name and the method as an array.
210+ If the static callback is stored in a different class, for example ``AppBundle\Entity\Genre ``,
211+ you can pass thefully-qualified class and the method as an array.
212212
213213..configuration-block ::
214214
@@ -222,7 +222,7 @@ you can pass the class name and the method as an array.
222222 class Author
223223 {
224224 /**
225- * @Assert\Choice(callback={"Util ", "getGenres"})
225+ * @Assert\Choice(callback={"AppBundle\Entity\Genre ", "getGenres"})
226226 */
227227 protected $genre;
228228 }
@@ -233,7 +233,7 @@ you can pass the class name and the method as an array.
233233AppBundle\Entity\Author :
234234properties :
235235genre :
236- -Choice :{ callback: [Util , getGenres] }
236+ -Choice :{ callback: [AppBundle\Entity\Genre , getGenres] }
237237
238238 ..code-block ::xml
239239
@@ -247,7 +247,7 @@ you can pass the class name and the method as an array.
247247 <property name =" genre" >
248248 <constraint name =" Choice" >
249249 <option name =" callback" >
250- <value >Util </value >
250+ <value >AppBundle\Entity\Genre </value >
251251 <value >getGenres</value >
252252 </option >
253253 </constraint >
@@ -260,6 +260,7 @@ you can pass the class name and the method as an array.
260260 // src/AppBundle/Entity/Author.php
261261 namespace AppBundle\Entity;
262262
263+ use AppBundle\Entity\Genre;
263264 use Symfony\Component\Validator\Mapping\ClassMetadata;
264265 use Symfony\Component\Validator\Constraints as Assert;
265266
@@ -270,7 +271,7 @@ you can pass the class name and the method as an array.
270271 public static function loadValidatorMetadata(ClassMetadata $metadata)
271272 {
272273 $metadata->addPropertyConstraint('genre', new Assert\Choice(array(
273- 'callback' => array('Util' , 'getGenres'),
274+ 'callback' => array(Genre::class , 'getGenres'),
274275 )));
275276 }
276277 }