Detailed Description
The rating class represents a single rating by a single user
- Copyright:
- 2010 Andrew Davis http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- Since:
- Moodle 2.0
Definition at line 45 of file lib.php.
Constructor & Destructor Documentation
Constructor.
- Parameters:
-
| object | $options | { context => context context to use for the rating [required] component => component using ratings ie mod_forum [required] ratingarea => ratingarea to associate this rating with [required] itemid => int the id of the associated item (forum post, glossary item etc) [required] scaleid => int The scale in use when the rating was submitted [required] userid => int The id of the user who submitted the rating [required] settings => Settings for the rating object [optional] id => The id of this rating (if the rating is from the db) [optional] aggregate => The aggregate for the rating [optional] count => The number of ratings [optional] rating => The rating given by the user [optional] } |
Definition at line 151 of file lib.php.
Member Function Documentation
Returns this ratings aggregate value as a string.
- Returns:
- string
Definition at line 239 of file lib.php.
Returns a URL that can be used to rate the associated item.
- Parameters:
-
| int | null | $rating | The rating to give the item, if null then no rating param is added. |
| moodle_url | string | $returnurl | The URL to return to. |
- Returns:
- moodle_url
Definition at line 348 of file lib.php.
Retreive the integer value of this rating
- Returns:
- int the integer value of this rating object
Definition at line 230 of file lib.php.
Returns a URL to view all of the ratings for the item this rating is for.
If this is a rating of a post then this URL will take the user to a page that shows all of the ratings for the post (this one included).
- Parameters:
-
- Returns:
- moodle_url
Definition at line 326 of file lib.php.
Update this rating in the database
- Parameters:
-
| int | $rating | the integer value of this rating |
- Returns:
- void
Definition at line 181 of file lib.php.
Returns true if the user is able to rate this rating object
- Parameters:
-
| int | $userid | Current user assumed if left empty |
- Returns:
- bool
Definition at line 263 of file lib.php.
Returns true if the user is able to view the aggregate for this rating object.
- Parameters:
-
| int | null | $userid | If left empty the current user is assumed. |
- Returns:
- bool
Definition at line 297 of file lib.php.
Field Documentation
The documentation for this class was generated from the following file:
- C:/xampp/htdocs/moodle/rating/lib.php