@@ -9,6 +9,10 @@ class Relation
99 protected int $ type ;
1010 protected string $ lastName ;
1111 protected string $ firstName ;
12+ protected ?string $ phone = null ;
13+ protected ?string $ mobilePhone = null ;
14+ protected ?string $ email = null ;
15+ protected ?string $ insz = null ;
1216
1317 /** @var null|array<string,mixed> $address */
1418 protected ?array $ address = null ;
@@ -122,6 +126,57 @@ public function setAddress(
122126 return $ this ;
123127 }
124128
129+ /**
130+ * Domicile phone number
131+ */
132+ public function setPhone (?string $ phone ): self
133+ {
134+ if ($ phone !== null && strlen ($ phone ) > 20 ) {
135+ throw new ValidationException ('Telefoonnummer mag maximum 20 karakters bevatten. ' );
136+ }
137+
138+ $ this ->phone = $ phone ;
139+ return $ this ;
140+ }
141+
142+ /**
143+ * Own mobile number
144+ */
145+ public function setMobilePhone (?string $ mobilePhone ): self
146+ {
147+ if ($ mobilePhone !== null && strlen ($ mobilePhone ) > 20 ) {
148+ throw new ValidationException ('GSM nummer mag maximum 20 karakters bevatten. ' );
149+ }
150+
151+ $ this ->mobilePhone = $ mobilePhone ;
152+ return $ this ;
153+ }
154+
155+ /**
156+ * Private email address
157+ */
158+ public function setEmail (?string $ email ): self
159+ {
160+ if ($ email !== null && false === filter_var ($ email , FILTER_VALIDATE_EMAIL )) {
161+ throw new ValidationException ('Ongeldig e-mailadres. ' );
162+ }
163+
164+ $ this ->email = $ email ;
165+ return $ this ;
166+ }
167+
168+ /**
169+ * The relation’s national registration number.
170+ *
171+ * This is either the Bisnummer, for foreign pupil, or
172+ * Rijksregisternummer for Belgium residents.
173+ */
174+ public function setInsz (?string $ insz ): self
175+ {
176+ $ this ->insz = $ insz ;
177+ return $ this ;
178+ }
179+
125180 /**
126181 * @return array<string,mixed>
127182 */
@@ -132,6 +187,10 @@ public function toArray(): array
132187 'lastName ' => $ this ->lastName ,
133188 'firstName ' => $ this ->firstName ,
134189 'Address ' => $ this ->address ,
190+ 'phone ' => $ this ->phone ,
191+ 'mobilePhone ' => $ this ->phone ,
192+ 'email ' => $ this ->email ,
193+ 'insz ' => $ this ->insz ,
135194 ];
136195 }
137196}
0 commit comments