\Oxws_Ratings

Functions related to ratings

Summary

Methods
Properties
Constants
getConfig()
getDb()
fetchArticleRatings()
fetchArticleAvgRating()
fetchAllRatings()
insertArticleRating()
updateArticleRating()
deleteArticleRatings()
deleteArticlesRatings()
deleteRating()
deleteRatings()
No public properties found
No constants found
No protected methods found
$myConfig
$oDb
N/A
No private methods found
No private properties found
N/A

Properties

$myConfig

$myConfig : object

Config object

Type

object

$oDb

$oDb : object

Database object

Type

object

Methods

getConfig()

getConfig() : object

Function to get config object

Returns

object

getDb()

getDb() : object

Function to get database object

Returns

object

fetchArticleRatings()

fetchArticleRatings(string  $articleId) : boolean

Function to fetch ratings of an article based on article oxid

Parameters

string $articleId

oxid of the article to fetch all its ratings

Returns

boolean

fetchArticleAvgRating()

fetchArticleAvgRating(string  $articleId) : string

Function to fetch average of ratings of an article based on article oxid

Parameters

string $articleId

oxid of the article to fetch its average rating

Returns

string

fetchAllRatings()

fetchAllRatings() : array

Function to fetch all the ratings of all the articles

Returns

array

insertArticleRating()

insertArticleRating(\JSONstring  $ratings) : boolean

Function to insert rating for an article

Parameters

\JSONstring $ratings

json string with rating details as key=>value pairs to insert. Ex: 'oxobjectid'=>'xxxxxx', 'oxrating'=>'x'.

Returns

boolean

updateArticleRating()

updateArticleRating(\JSONstring  $ratings) : boolean

Function to update rating of an article

Parameters

\JSONstring $ratings

json string with rating details as key=>value pairs to update. Ex: 'oxid'=>'xxxxxx', 'oxrating'=>'x'.

Returns

boolean

deleteArticleRatings()

deleteArticleRatings(string  $articleId = "") : boolean

Function to delete ratings of an article

Parameters

string $articleId

oxid of the article to be deleted

Returns

boolean

deleteArticlesRatings()

deleteArticlesRatings(string  $articleIds) : null

Function to delete ratings of multiple articles based on oxid of the articles

Parameters

string $articleIds

array of oxids of the articles to be deleted

Returns

null

deleteRating()

deleteRating(array  $ratingId = "") : boolean

Function to delete rating based on oxid of the rating

Parameters

array $ratingId

oxid of the rating to be deleted

Returns

boolean

deleteRatings()

deleteRatings(array  $ratingIds) : null

Function to delete multiple ratings based on oxid of the ratings

Parameters

array $ratingIds

array of oxids of the ratings to be deleted

Returns

null