function json() { if (isset($this->return_data)) { return json_encode($this->return_data); } else { echo MessageLogger::asJSON(); } }