loadedPhone = $this->phone; $this->loadedMobile = $this->mobile; } public function isPhoneNewlyEntered(): bool { return AppAssert\PhoneNumber::isNewlyEntered($this->phone, $this->loadedPhone); } public function isMobileNewlyEntered(): bool { return AppAssert\PhoneNumber::isNewlyEntered($this->mobile, $this->loadedMobile); } /** * Converts the communication data to API payload format. * * Transforms the communication object into an array structure suitable * for API communication with the BusProNet system. * * @return array The payload array for API transmission */ public function toPayload(): array { return [ 'email' => $this->email, 'telefonmobil' => $this->mobile, 'telefonprivat' => $this->phone, 'newsletter' => $this->newsletter ? 'True' : 'False', ]; } }