Movable Type comes with a scoring framework built in. What does that mean? It means that a developer can very easily bootstrap any object/class/package they define to expose methods to allow for plugins to score, both positively and negatively that object.
Inheriting from the Scorable Interface
To make an object scorable, a developer need only state that their package inherits from the MT::Scorable interface.
package My::Object::Model;
use base qw( MT::Object MT::Scorable );
__PACKAGE__->install_properties({
# ...
});
1;
Using the MT::Scorable Interface
Then you get the methods in the Scorable interface on your model objects:
sub score_myobject {
my ($m_id) = @_;
my $m = My::Object::Model->load($m_id);
my $is_awesome = $m->score_avg('percent-rating') > 80 ? 1 : 0;
if ($is_awesome) {
# do something wicked
}
}
Submit a User Contributed Note
User contributed notes are a great way to share the knowledge you have gained in using Movable Type.
If you have a technical question or problem, please visit Movable Type Support.