/** * Converts an Rate object into an associative array for JSON encoding * * @param Rate $rating Rating object * * @return array Associative array whose fields are the rating properties. */ private function buildRateArray(Rating $rating) { $datas = array("widget_id" => $rating->getArticleId(), "number_votes" => $rating->getNumberVotes(), "total_points" => $rating->getTotalPoints(), "dec_avg" => $rating->getDecAvg(), "whole_avg" => $rating->getWholeAvg()); return $datas; }