dmRating Class Reference

Inheritance diagram for dmRating:
dmModel

Public Member Functions


Detailed Description

Definition at line 20 of file dmRating.class.php.


Constructor & Destructor Documentation

dmRating::__construct ( value,
max 
) [final]

A rating value has no meaning without a scale: 1 out of 5, 8 out of 10, etc.

This constructor takes a value (numerator) and a maximum value (denominator).

Parameters:
int value Numerator
int max Denominator
Exceptions:
dmIllegalArgumentException 
Since:
0.1

Definition at line 35 of file dmRating.class.php.


Member Function Documentation

dmRating::__toString (  )  [final]

Returns the rating's value as a string, rounded to 2 decimal places.

Do not depend on this method, as it is not guaranteed to be stable; getValue() is more precise and preferred.

Returns:
string
See also:
dmRating::getValue()
Since:
0.1

Definition at line 54 of file dmRating.class.php.

dmRating::getMax (  )  [final]
Returns:
int|float The largest value of the rating scale.
Since:
0.1

Definition at line 62 of file dmRating.class.php.

Referenced by getNormalizedValue().

dmRating::getNormalizedValue (  )  [final]

Normalizes the rating to a scale of 0-100 for storage.

Returns:
float
Since:
0.1

Definition at line 87 of file dmRating.class.php.

Referenced by dmObject::addRating().

dmRating::getValue (  )  [final]
Returns:
float The value of the rating, on the scale of 0 to getMax().
Since:
0.1

Definition at line 95 of file dmRating.class.php.

Referenced by __toString(), getNormalizedValue(), and setMax().

dmRating::setMax ( max  )  [final]
Parameters:
int|float max A positive number.
Exceptions:
dmIllegalArgumentException 
Since:
0.1

Definition at line 71 of file dmRating.class.php.

Referenced by __construct().

dmRating::setValue ( float  )  [final]
Parameters:
float float
Exceptions:
dmIllegalArgumentException 
Since:
0.1

Definition at line 104 of file dmRating.class.php.

Referenced by __construct().


The documentation for this class was generated from the following file:

Generated on Fri Aug 20 13:16:50 2010 for dmBridge PHP API by  doxygen 1.6.1