id = $id; $this->username = $username; $this->firstName = $firstName; $this->lastName = $lastName; $this->email = $email; $this->password = $password; $this->phone = $phone; $this->userStatus = $userStatus; } public static function fromArray(array $data): self { return new self( $data['id'] ?? null, $data['username'] ?? null, $data['firstName'] ?? null, $data['lastName'] ?? null, $data['email'] ?? null, $data['password'] ?? null, $data['phone'] ?? null, $data['userStatus'] ?? null, ); } public function jsonSerialize(): mixed { return [ 'id' => $this->id, 'username' => $this->username, 'firstName' => $this->firstName, 'lastName' => $this->lastName, 'email' => $this->email, 'password' => $this->password, 'phone' => $this->phone, 'userStatus' => $this->userStatus, ]; } }