NAME
MT::Scorable - An interface for any MT::Object that wishes to rated.
SYNOPSIS
use MT::Entry; my $entry = MT::Entry->load($id); $entry->set_score('key', $app->user, 100, $overwrite);
METHODS
get_score($namespace, $user)
Return the score of the object, scored by the user specified. This is not for total score of an object. This is to get a score specified by a user to an object.
set_score($namespace, $user, $score, $overwrite)
Set specified score to the object by the user. If $overwrite argument is false and the user has already scored the object before, error results.
score_for($namespace)
Return the total score of the object.
vote_for($namespace)
Return how many users scored to the object.
score_high($namespace)
Return the highest score to the object.
score_low($namespace)
Return the lowest score to the object.
score_avg($namespace)
Return the average score of the object.
rank_for($namespace, $max)
Return the rank of the object based on its score among other objects of the same type. The smaller the number is, the higher the object's rank is.
AUTHOR & COPYRIGHT
Please see "AUTHOR & COPYRIGHT" in MT.