LibertyStars Class Reference

Inheritance diagram for LibertyStars:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 calculateRating (&$pParamHash)
 calculateUserWeight ($pUserId=NULL)
 expunge ()
 getList (&$pListHash)
 getRatingSummary ($pContentId=NULL)
 getUserRating ($pContentId=NULL)
 isValid ()
 LibertyStars ($pContentId=NULL)
 load ()
 loadRatingDetails ()
 reCalculateRating ()
 store (&$pParamHash)
 verify (&$pParamHash)

Public Attributes

 $mContentId

Detailed Description

Definition at line 20 of file LibertyStars.php.


Member Function Documentation

LibertyStars::calculateRating ( &$  pParamHash  ) 

Calculate the correct value to insert into the database

Parameters:
array $pParamHash public
Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 376 of file LibertyStars.php.

References $gBitSystem, $gBitUser, $pParamHash, $result, $ret, $stars, calculateUserWeight(), FALSE, getRatingSummary(), getUserRating(), isValid(), mContentId, mDb, mUserId, and BitBase::verifyId().

Referenced by verify().

Here is the call graph for this function:

LibertyStars::calculateUserWeight ( pUserId = NULL  ) 

Calculate the importance of a users rating

Parameters:
array $pUserId User id public
Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 420 of file LibertyStars.php.

References $gBitSystem, $gBitUser, $query, $ret, $type, BitBase::getField(), BitDate::getUTCTime(), mDb, and BitBase::verifyId().

Referenced by calculateRating(), and reCalculateRating().

Here is the call graph for this function:

LibertyStars::expunge (  ) 

This function removes a stars entry

public

Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 303 of file LibertyStars.php.

References $query, $result, $ret, FALSE, isValid(), mContentId, and mDb.

Here is the call graph for this function:

LibertyStars::getList ( &$  pListHash  ) 

get list of all rated content

Parameters:
$pListHash contains array of items used to limit search results
$pListHash[sort_mode] column and orientation by which search results are sorted
$pListHash[find] search for a pigeonhole title - case insensitive
$pListHash[max_records] maximum number of rows to return
$pListHash[offset] number of results data is offset by public
Returns:
array of rated content

Definition at line 66 of file LibertyStars.php.

References $gBitSystem, $gBitUser, $gLibertySystem, $query, $result, $ret, $type, mDb, mPackages, BitBase::postGetList(), BitBase::prepGetList(), and title.

Here is the call graph for this function:

LibertyStars::getRatingSummary ( pContentId = NULL  ) 

Quick method to get a nice summary of past ratings for a given content

Parameters:
array $pContentId public
Returns:
usable hash with a summary of ratings of a given content id

Definition at line 170 of file LibertyStars.php.

References $query, $result, $ret, isValid(), mContentId, mDb, and BitBase::verifyId().

Referenced by calculateRating(), and reCalculateRating().

Here is the call graph for this function:

LibertyStars::getUserRating ( pContentId = NULL  ) 

Get the rating of the currently active user for the specified content

Parameters:
array $pContentId public
Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 268 of file LibertyStars.php.

References $gBitSystem, $gBitUser, $pixels, $query, $ret, $stars, FALSE, isValid(), mContentId, mDb, mUserId, and BitBase::verifyId().

Referenced by calculateRating(), and store().

Here is the call graph for this function:

LibertyStars::isValid (  ) 

Check if the mContentId is set and valid

public

Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 293 of file LibertyStars.php.

References mContentId, and BitBase::verifyId().

Referenced by calculateRating(), expunge(), getRatingSummary(), getUserRating(), load(), loadRatingDetails(), and verify().

Here is the call graph for this function:

LibertyStars::LibertyStars ( pContentId = NULL  ) 

Initiate Liberty Stars

Parameters:
array $pContentId Content id of the item being rated public
Returns:
void

Definition at line 30 of file LibertyStars.php.

References LibertyBase::LibertyBase(), and mContentId.

Here is the call graph for this function:

LibertyStars::load (  ) 

Load the data from the database

public

Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 41 of file LibertyStars.php.

References $gBitSystem, $pixels, $query, $stars, isValid(), mContentId, mDb, and mInfo.

Referenced by verify().

Here is the call graph for this function:

LibertyStars::loadRatingDetails (  ) 

Get the rating history of a loaded content

Parameters:
boolean $pExtras loading the extras will get all users who have rated in the past and their ratings public
Returns:
TRUE on success, FALSE on failure

Definition at line 140 of file LibertyStars.php.

References $gBitSystem, $pixels, $query, $stars, LibertyBase::getLibertyObject(), isValid(), mContentId, mDb, and mInfo.

Here is the call graph for this function:

LibertyStars::reCalculateRating (  ) 

recalculate the rating of all objects - important when user changes weighting opions TODO: add some check to see if this was successfull, currenlty only returns true

public

Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 323 of file LibertyStars.php.

References $gBitSystem, $result, $storeHash, $userId, calculateUserWeight(), getRatingSummary(), and mDb.

Here is the call graph for this function:

LibertyStars::store ( &$  pParamHash  ) 

Parameters:
array pParams hash of values that will be used to store the page
Returns:
bool TRUE on success, FALSE if store could not occur. If FALSE, $this->mErrors will have reason why public

Definition at line 202 of file LibertyStars.php.

References $gBitUser, $pParamHash, $result, getUserRating(), mContentId, mDb, mInfo, mUserId, and verify().

Here is the call graph for this function:

LibertyStars::verify ( &$  pParamHash  ) 

Make sure the data is safe to store

Parameters:
array pParams reference to hash of values that will be used to store the page, they will be modified where necessary
Returns:
bool TRUE on success, FALSE if verify failed. If FALSE, $this->mErrors will have reason why private

Definition at line 232 of file LibertyStars.php.

References $gBitSystem, $gBitUser, $pParamHash, calculateRating(), BitDate::getUTCTime(), isValid(), load(), mContentId, and mUserId.

Referenced by store().

Here is the call graph for this function:


Member Data Documentation

LibertyStars::$mContentId

Definition at line 21 of file LibertyStars.php.


The documentation for this class was generated from the following file:
Generated on Wed Aug 22 19:34:44 2007 for bitweaver by  doxygen 1.5.2