@@ -960,10 +960,11 @@ entity and a new constraint group called ``Premium``:
960
960
private $name;
961
961
962
962
/**
963
- * @Assert\CardScheme(
964
- * schemes={"VISA"},
965
- * groups={"Premium"},
966
- * )
963
+ * @Assert\CardScheme(
964
+ * schemes={"VISA"},
965
+ * groups={"Premium"},
966
+ * )
967
+ */
967
968
private $creditCard;
968
969
}
969
970
@@ -1024,14 +1025,14 @@ entity and a new constraint group called ``Premium``:
1024
1025
}
1025
1026
}
1026
1027
1027
- Now, let this class implement
1028
- :class: `Symfony\\ Componet \\ Validation\\ GroupSequenceProviderInterface ` and
1029
- implement a method called
1030
- :method: `Symfony\\ Componet \\ Validation\\ GroupSequenceProviderInterface::getGroupSequence `,
1031
- which returns an array of groups to use and add the
1032
- ``@Assert\GroupSequencdeProvider `` annotation to the class. Imagine a method
1033
- ``isPremium `` returns true if the user is a premium member. Your method looks
1034
- like this::
1028
+ Now, change the `` User `` class to implement
1029
+ :class: `Symfony\\ Component \\ Validation\\ GroupSequenceProviderInterface ` and
1030
+ add the
1031
+ :method: `Symfony\\ Component \\ Validation\\ GroupSequenceProviderInterface::getGroupSequence `,
1032
+ which should return an array of groups to use. Also, add the
1033
+ ``@Assert\GroupSequenceProvider `` annotation to the class. If you imagine
1034
+ that a method called ``isPremium `` returns true if the user is a premium member,
1035
+ then your code might look like this::
1035
1036
1036
1037
// src/Acme/DemoBundle/Entity/User.php
1037
1038
namespace Acme\DemoBundle\Entity;
@@ -1043,7 +1044,7 @@ like this::
1043
1044
* @Assert\GroupSequenceProvider
1044
1045
* ...
1045
1046
*/
1046
- class User
1047
+ class User implements GroupSequenceProviderInterface
1047
1048
{
1048
1049
// ...
1049
1050
0 commit comments