SheaDawson\Rateable\Services\RateableService
- Author: Shea Dawson <shea@silverstripe.com.au>
- License: BSD http://silverstripe.org/BSD-license
Synopsis
class RateableService
{
- // methods
- public Rating|boolean userGetRating()
- public Boolean userHasRated()
- public DataList getRatingsFor()
- public ArrayList sortByRating()
Methods
public
- getRatingsFor() — gets the rating objects for an object
- sortByRating() — takes a DataList of Rateable DataObjects and sorts them by their average score
- userGetRating() — Checks to see if a user has already rated this object and returns the record.
- userHasRated() — checks to see if a user has already rated this object by checking against their SessionID or MemberID if logged in