Contentserv PHP API

CSItemApiRating
in package

Defines API method of ratings in the ItemModell

Tags
access

public

since
5.0

Table of Contents

getMyLastVisited()  : array<string|int, mixed>
Returns the first $limit records which are last visited
getMyRatedRecords()  : array<string|int, mixed>
Returns the first $limit records which are rated by me
getMyRating()  : Itemrating
Gets the current users rating for a record
getRatings()  : array<string|int, mixed>
Returns all defined ratings for the given record
getRecord()  : the
Returns the current item record
getTopRated()  : array<string|int, mixed>
Returns the first $limit records which are rated best
getTopVisited()  : array<string|int, mixed>
Returns the first $limit records which are most visited
getTotalRating()  : float
Returns the total rating for the record
rate()  : void
Mark the current record as visited
visit()  : void
Mark the current record as visited

Methods

getMyLastVisited()

Returns the first $limit records which are last visited

public static getMyLastVisited(object $record[, int $limit = 10 ], int $subType[, array<string|int, mixed> $idList = array() ][, string $recordSql = '' ]) : array<string|int, mixed>
Parameters
$record : object

the Record which should be evaluated

$limit : int = 10

limites the result (if it is set to 0 all rated are returned)

$subType : int

the optional subtype

$idList : array<string|int, mixed> = array()

a list of RecordIDs to which the search should be limited, e.g. for root filters, ...

$recordSql : string = ''

a sql filter which should be applied on the joined record datasource

Tags
access

public

Return values
array<string|int, mixed>

the RecordIDs of the last visited records

getMyRatedRecords()

Returns the first $limit records which are rated by me

public static getMyRatedRecords(object $record[, int $limit = 10 ], int $subType[, array<string|int, mixed> $idList = array() ][, string $recordSql = '' ]) : array<string|int, mixed>
Parameters
$record : object

the Record which should be evaluated

$limit : int = 10

limites the result (if it is set to 0 all rated are returned)

$subType : int

the optional subtype

$idList : array<string|int, mixed> = array()

a list of RecordIDs to which the search should be limited, e.g. for root filters, ...

$recordSql : string = ''

a sql filter which should be applied on the joined record datasource

Tags
access

public

Return values
array<string|int, mixed>

the RecordIDs of my last rated records

getMyRating()

Gets the current users rating for a record

public getMyRating(int $subType) : Itemrating
Parameters
$subType : int

the optional subtype

Tags
access

public

Return values
Itemrating

the current rating object

getRatings()

Returns all defined ratings for the given record

public getRatings([string $filter = '' ][, string $order = 'LastVisited DESC' ]) : array<string|int, mixed>
Parameters
$filter : string = ''

a sql filter which should be applied

$order : string = 'LastVisited DESC'

a sql order by condition

Tags
access

public

Return values
array<string|int, mixed>

of Itemrating Records

getRecord()

Returns the current item record

public getRecord() : the
Tags
access

public

Return values
the

current item record

getTopRated()

Returns the first $limit records which are rated best

public static getTopRated(object $record[, int $limit = 10 ], int $subType[, array<string|int, mixed> $idList = array() ][, string $recordSql = '' ]) : array<string|int, mixed>
Parameters
$record : object

the Record which should be evaluated

$limit : int = 10

limites the result (if it is set to 0 all rated are returned)

$subType : int

the optional subtype

$idList : array<string|int, mixed> = array()

a list of RecordIDs to which the search should be limited, e.g. for root filters, ...

$recordSql : string = ''

a sql filter which should be applied on the joined record datasource

Tags
access

public

Return values
array<string|int, mixed>

the RecordIDs of the best rated records

getTopVisited()

Returns the first $limit records which are most visited

public static getTopVisited(object $record[, int $limit = 10 ], int $subType[, array<string|int, mixed> $idList = array() ][, string $recordSql = '' ]) : array<string|int, mixed>
Parameters
$record : object

the Record which should be evaluated

$limit : int = 10

limites the result (if it is set to 0 all rated are returned)

$subType : int

the optional subtype

$idList : array<string|int, mixed> = array()

a list of RecordIDs to which the search should be limited, e.g. for root filters, ...

$recordSql : string = ''

a sql filter which should be applied on the joined record datasource

Tags
access

public

Return values
array<string|int, mixed>

the RecordIDs of the most visited records

getTotalRating()

Returns the total rating for the record

public getTotalRating(int $subType) : float
Parameters
$subType : int

the optional subtype

Tags
access

public

Return values
float

the rating for the record

rate()

Mark the current record as visited

public rate(int $rating, int $subType) : void
Parameters
$rating : int

the new rating

$subType : int

the optional subtype

Tags
access

public

Return values
void

visit()

Mark the current record as visited

public visit(int $subType) : void
Parameters
$subType : int

the optional subtype

Tags
access

public

Return values
void

        

Search results