Fix wrong object in Ratings. re #137

This commit is contained in:
Sébastien Lucas 2014-03-27 14:06:26 +01:00
parent 711a3a6576
commit f50e925c3d

View file

@ -15,7 +15,6 @@ class Rating extends Base {
const SQL_ALL_RATINGS ="select {0} from ratings, books_ratings_link where books_ratings_link.rating = ratings.id group by ratings.id order by ratings.rating"; const SQL_ALL_RATINGS ="select {0} from ratings, books_ratings_link where books_ratings_link.rating = ratings.id group by ratings.id order by ratings.rating";
public $id; public $id;
public $name; public $name;
public $sort;
public function __construct($pid, $pname) { public function __construct($pid, $pname) {
$this->id = $pid; $this->id = $pid;
@ -60,6 +59,6 @@ class Rating extends Base {
public static function getRatingById ($ratingId) { public static function getRatingById ($ratingId) {
$result = parent::getDb ()->prepare('select rating from ratings where id = ?'); $result = parent::getDb ()->prepare('select rating from ratings where id = ?');
$result->execute (array ($ratingId)); $result->execute (array ($ratingId));
return new Author ($ratingId, $result->fetchColumn ()); return new Rating ($ratingId, $result->fetchColumn ());
} }
} }