customer_id, customerName: $json->customer_name, customerEmail: $json->customer_email, ); } public function toJson($options = 0): string { return json_encode($this->toArray(), $options); } /** @return array */ public function toArray(): array { return [ 'customer_id' => $this->customerId, 'customer_name' => $this->customerName, 'customer_email' => $this->customerEmail, ]; } }