@@ -27,14 +27,18 @@ class Field
27
27
28
28
private mixed $ default = null ;
29
29
30
+ private mixed $ discriminator = null ;
31
+
30
32
public function __construct (
31
33
private string $ name ,
32
34
private FieldType $ type ,
33
35
private ConstraintCollection $ constraints ,
34
36
private string $ referenceName ,
35
37
private bool $ required ,
36
38
private bool $ nullable ,
37
- private bool $ additionalProperties
39
+ private bool $ additionalProperties ,
40
+ private bool $ hasOneOf = false ,
41
+ private bool $ hasAnyOf = false
38
42
) {
39
43
}
40
44
@@ -62,6 +66,9 @@ public function getObjectProperties(): array
62
66
return $ this ->objectProperties ;
63
67
}
64
68
69
+ /**
70
+ * @param Field[] $objectProperties
71
+ */
65
72
public function setObjectProperties (array $ objectProperties ): self
66
73
{
67
74
$ this ->objectProperties = $ objectProperties ;
@@ -128,6 +135,16 @@ public function isNullable(): bool
128
135
return $ this ->nullable ;
129
136
}
130
137
138
+ public function hasOneOf (): bool
139
+ {
140
+ return $ this ->hasOneOf ;
141
+ }
142
+
143
+ public function hasAnyOf (): bool
144
+ {
145
+ return $ this ->hasAnyOf ;
146
+ }
147
+
131
148
public function isDate (): bool
132
149
{
133
150
$ isDateFormat = $ this ->getFormat () === self ::FORMAT_DATE || $ this ->getFormat () === self ::FORMAT_DATE_TIME ;
@@ -169,6 +186,18 @@ public function setDefault(mixed $default): self
169
186
return $ this ;
170
187
}
171
188
189
+ public function getDiscriminator (): mixed
190
+ {
191
+ return $ this ->discriminator ;
192
+ }
193
+
194
+ public function setDiscriminator (mixed $ discriminator ): self
195
+ {
196
+ $ this ->discriminator = $ discriminator ;
197
+
198
+ return $ this ;
199
+ }
200
+
172
201
public function getPhpVariableName (): string
173
202
{
174
203
return CaseCaster::toCamel ($ this ->name );
0 commit comments