IP.Board  3.3.0
classReputationCache Class Reference

Public Member Functions

 __construct ()
 addRate ($type, $type_id, $rating, $message='', $member_id=0, $app='')
 formatLikeNameString (array $data, array $item)
 getCurrentMemberRating ($data)
 getCurrentRating ($data)
 getDataByRelationshipId ($data)
 getLikeData ($data)
 getLikeFormatted ($item)
 getLikeRawData ($data)
 getReputation ($points)
 getTotalRatingJoin ($type, $type_id, $app='')
 getUserHasRatedJoin ($type, $type_id, $app='')
 isLikeMode ()
 updateCache ($app, $type, $type_id)

Data Fields

 $error_message
 $rep_system_on

Constructor & Destructor Documentation

CONSTRUCTOR

public

Returns:
void

Member Function Documentation

addRate ( type,
type_id,
rating,
message = '',
member_id = 0,
app = '' 
)

Adds a rating to the index and updates caches

public

Parameters:
string$typeType of content, ex; Post
integer$type_idID of the type, ex: pid
integer$ratingEither 1 or -1
string$messageMessage associated with this rating
integer$member_idId of the owner of the content being rated
string[$app] App for this content, by default the current application
Returns:
bool
formatLikeNameString ( array $  data,
array $  item 
)

Formats the Bob, Bill, Joe and 2038 Others Hate You

Parameters:
array$data
array$itemData (id, type, app)
Returns:
string

Has this member rated this item?

Parameters:
array$data(app, id, type, memberId )
Returns:
boolean
getCurrentRating ( data)

Has this member rated this item?

Parameters:
array$data(app, id, type, memberId )
Returns:
int

Get data based on a relationship ID

Parameters:
array$data(id, type, app)
Returns:
mixed Array of like data OR null
getLikeData ( data)

Gets 'like' data for this item

Parameters:
array( id, type, app )
Returns:
array
getLikeFormatted ( item)

Get 'like' formatted for this item

Parameters:
arrayData array ( id, type, app )
getLikeRawData ( data)

Get the like data from the DB (no cache)

Parameters:
array$dataLike data ( id, type, app )
Returns:
array Cache data
getReputation ( points)

Returns an array of reputation information based on the points passed in

public

Parameters:
integer$pointsNumber of points to base the repuation information on
Returns:
array 'text' and 'image'
getTotalRatingJoin ( type,
type_id,
app = '' 
)

Retuns an array for use in a join statement

public

Parameters:
string$typeType of content, ex; Post
integer$type_idID of the type, ex: pid
string[$app] App for this content, by default the current application
Returns:
array
getUserHasRatedJoin ( type,
type_id,
app = '' 
)

Retuns an array for use in a join statement

public

Parameters:
string$typeType of content, ex; Post
integer$type_idID of the type, ex: pid
string[$app] App for this content, by default the current application
Returns:
array

Is this in like mode?

updateCache ( app,
type,
type_id 
)

Handles updating and creating new caches

private

Parameters:
string$appApp for this content
string$typeType of content, ex; Post
integer$type_idID of the type, ex: pid
Returns:
void

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables