@@ -69,7 +69,7 @@ One way to accomplish this is with the When constraint:
69
69
{
70
70
#[Assert\GreaterThan(0)]
71
71
#[Assert\When(
72
- expression: 'this.type == "percent"',
72
+ expression: 'this.getType() == "percent"',
73
73
constraints: [
74
74
new Assert\LessThanOrEqual(100, message: 'The value should be between 1 and 100!')
75
75
],
@@ -87,7 +87,7 @@ One way to accomplish this is with the When constraint:
87
87
value :
88
88
- GreaterThan : 0
89
89
- When :
90
- expression : " this.type == 'percent'"
90
+ expression : " this.getType() == 'percent'"
91
91
constraints :
92
92
- LessThanOrEqual :
93
93
value : 100
@@ -105,7 +105,7 @@ One way to accomplish this is with the When constraint:
105
105
<constraint name =" GreaterThan" >0</constraint >
106
106
<constraint name =" When" >
107
107
<option name =" expression" >
108
- this.type == 'percent'
108
+ this.getType() == 'percent'
109
109
</option >
110
110
<option name =" constraints" >
111
111
<constraint name =" LessThanOrEqual" >
@@ -132,7 +132,7 @@ One way to accomplish this is with the When constraint:
132
132
{
133
133
$metadata->addPropertyConstraint('value', new Assert\GreaterThan(0));
134
134
$metadata->addPropertyConstraint('value', new Assert\When([
135
- 'expression' => 'this.type == "percent"',
135
+ 'expression' => 'this.getType() == "percent"',
136
136
'constraints' => [
137
137
new Assert\LessThanOrEqual([
138
138
'value' => 100,
0 commit comments