/** * Return the reward in JSON format. * * @return the reward in JSON format */ public function toJson() { $response = array(); if (count($this->getBadges()) > 0) { $response["badges"] = Badge::getValues($this->getBadges()); } else { $response["badges"] = array(); } $response["koin_count_new"] = $this->getKoinCountNew(); $response["koin_count_total"] = $this->getKoinCountTotal(); return json_encode($response); }