address = new Address(); $this->communication = new Communication(); } /** * Converts the registration data to API payload format. * * @return array */ public function toPayload(): array { return [ 'geschlecht' => $this->gender, 'vorname' => $this->firstName, 'name' => $this->name, 'nationalitaet' => $this->nationality, 'geburtsdatum' => $this->dateOfBirth?->format('d.m.Y'), 'anschrift' => $this->address->toPayload(), 'kommunikation' => $this->communication->toPayload(), ]; } }