Ampache
[ class tree: Ampache ] [ index: Ampache ] [ all elements ]

Class: Rating

Source Location: /lib/class/rating.class.php

Class Overview

database_object
   |
   --Rating

Rating class This is an amalgamation(sp?) of code from SoundOfEmotion to track ratings for songs, albums and artists.


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 27]
Rating class This is an amalgamation(sp?) of code from SoundOfEmotion to track ratings for songs, albums and artists.



[ Top ]


Class Variables

$id =

[line 30]


Type:   mixed


[ Top ]

$preciserating =

[line 35]


Type:   mixed


[ Top ]

$rating =

[line 34]


Type:   mixed


[ Top ]

$type =

[line 31]


Type:   mixed


[ Top ]



Class Methods


static method build_cache [line 66]

static void build_cache( $type, $ids)

build_cache

This attempts to get everything we'll need for this page load in a single query, saving the connection overhead //FIXME: Improve logic so that misses get cached as average




Tags:

access:  public


Parameters:

   $type  
   $ids  

[ Top ]

static method show [line 220]

static void show( $object_id, $type)

show This takes an id and a type and displays the rating if ratings are enabled.



Tags:

access:  public


Parameters:

   $object_id  
   $type  

[ Top ]

static method show_static [line 235]

static void show_static( $object_id, $type)

show_static

This is a static version of the ratings created by Andy90




Tags:

access:  public


Parameters:

   $object_id  
   $type  

[ Top ]

constructor __construct [line 42]

Rating __construct( $id, $type)

Constructor

This is run every time a new object is created, it requires the id and type of object that we need to pull the raiting for




Tags:

access:  public


Parameters:

   $id  
   $type  

[ Top ]

method get_average [line 141]

void get_average( )

get_average

Get the users average rating this is based off the floor'd average of what everyone has rated this album as. This is shown if there is no personal rating, and used for random play mojo. It sets $this->average_rating and returns the value




Tags:

access:  public


[ Top ]

method get_user [line 113]

void get_user( $user_id)

get_user

Get the user's rating this is based off the currently logged in user. It returns the value




Tags:

access:  public


Parameters:

   $user_id  

[ Top ]

method set_rating [line 185]

void set_rating( $score)

set_rating This function sets a rating for the current $this object.

This uses the currently logged in user for the 'user' who is rating the object. Returns true on success, false on failure




Tags:

access:  public


Parameters:

   $score  

[ Top ]


Documentation generated on Thu, 12 Feb 2009 08:00:06 +0900 by phpDocumentor 1.4.2