Ejemplo n.º 1
0
 public function get_recommendations()
 {
     $app = JFactory::getApplication();
     $userId = JFactory::getUser()->get('id');
     $articleId = JRequest::getInt('article_id');
     $recommendations = ideary::getRecommendations($articleId, $userId);
     $result = null;
     if (count($recommendations) > 0) {
         $recommendation = $recommendations[0];
         $url = ContentHelperRoute::getArticleRoute($recommendation->id, $recommendation->catid);
         $result = array("recommendation" => $recommendation, "url" => $url);
     }
     echo json_encode($result);
     $app->close();
 }