@@ -46,7 +46,7 @@ Configuration
46
46
/**
47
47
* @Assert\Callback
48
48
*/
49
- public function validate(ExecutionContextInterface $context)
49
+ public function validate(ExecutionContextInterface $context, $payload )
50
50
{
51
51
// ...
52
52
}
@@ -103,7 +103,7 @@ field those errors should be attributed::
103
103
// ...
104
104
private $firstName;
105
105
106
- public function validate(ExecutionContextInterface $context)
106
+ public function validate(ExecutionContextInterface $context, $payload )
107
107
{
108
108
// somehow you have an array of "fake names"
109
109
$fakeNames = array(/* ... */);
@@ -123,7 +123,7 @@ Static Callbacks
123
123
You can also use the constraint with static methods. Since static methods don't
124
124
have access to the object instance, they receive the object as the first argument::
125
125
126
- public static function validate($object, ExecutionContextInterface $context)
126
+ public static function validate($object, ExecutionContextInterface $context, $payload )
127
127
{
128
128
// somehow you have an array of "fake names"
129
129
$fakeNames = array(/* ... */);
@@ -151,7 +151,7 @@ Suppose your validation function is ``Vendor\Package\Validator::validate()``::
151
151
152
152
class Validator
153
153
{
154
- public static function validate($object, ExecutionContextInterface $context)
154
+ public static function validate($object, ExecutionContextInterface $context, $payload )
155
155
{
156
156
// ...
157
157
}
@@ -240,7 +240,7 @@ constructor of the Callback constraint::
240
240
{
241
241
public static function loadValidatorMetadata(ClassMetadata $metadata)
242
242
{
243
- $callback = function ($object, ExecutionContextInterface $context) {
243
+ $callback = function ($object, ExecutionContextInterface $context, $payload ) {
244
244
// ...
245
245
};
246
246
0 commit comments