type = $type; $this->message = $message; } public function toJson() { return json_encode(array( 'type' => $this->type, 'message' => $this->message )); } } ?>