Zend Framework
1.12
|
Public Member Functions | |
__construct ($value, $type=null, $locale=null) | |
Zend_Measure_Abstract is an abstract class for the different measurement types. | |
getLocale () | |
Returns the actual set locale. | |
setLocale ($locale=null, $check=false) | |
Sets a new locale for the value representation. | |
getValue ($round=-1, $locale=null) | |
Returns the internal value. | |
setValue ($value, $type=null, $locale=null) | |
Set a new value. | |
getType () | |
Returns the original type. | |
setType ($type) | |
Set a new type, and convert the value. | |
equals ($object) | |
Compare if the value and type is equal. | |
toString ($round=-1, $locale=null) | |
Returns a string representation. | |
__toString () | |
Returns a string representation. | |
getConversionList () | |
Returns the conversion list. | |
convertTo ($type, $round=2, $locale=null) | |
Alias function for setType returning the converted unit. | |
add ($object) | |
Adds an unit to another one. | |
sub ($object) | |
Substracts an unit from another one. | |
compare ($object) | |
Compares two units. | |
Protected Attributes | |
$_value | |
Plain value in standard unit. | |
$_type | |
Original type for this unit. | |
$_locale = null | |
Locale identifier. | |
$_units = array() | |
Unit types for this measurement. | |
__construct | ( | $value, | |
$type = null , |
|||
$locale = null |
|||
) |
Zend_Measure_Abstract is an abstract class for the different measurement types.
mixed | $value | Value as string, integer, real or float |
int | $type | OPTIONAL a measure type f.e. Zend_Measure_Length::METER |
Zend_Locale | $locale | OPTIONAL a Zend_Locale Type |
Zend_Measure_Exception |
__toString | ( | ) |
Returns a string representation.
add | ( | $object | ) |
Adds an unit to another one.
Zend_Measure_Abstract | $object | object of same unit type |
compare | ( | $object | ) |
convertTo | ( | $type, | |
$round = 2 , |
|||
$locale = null |
|||
) |
Alias function for setType returning the converted unit.
string | $type | Constant Type |
integer | $round | (Optional) Rounds the value to a given precision |
string | Zend_Locale | $locale | (Optional) Locale to set for the number |
equals | ( | $object | ) |
Compare if the value and type is equal.
Zend_Measure_Abstract | $object | object to compare |
getConversionList | ( | ) |
Returns the conversion list.
getLocale | ( | ) |
Returns the actual set locale.
getType | ( | ) |
Returns the original type.
getValue | ( | $round = -1 , |
|
$locale = null |
|||
) |
Returns the internal value.
integer | $round | (Optional) Rounds the value to an given precision, Default is -1 which returns without rounding |
string | Zend_Locale | $locale | (Optional) Locale for number representation |
setLocale | ( | $locale = null , |
|
$check = false |
|||
) |
Sets a new locale for the value representation.
string | Zend_Locale | $locale | (Optional) New locale to set |
boolean | $check | False, check but don't set; True, set the new locale |
setType | ( | $type | ) |
Set a new type, and convert the value.
string | $type | New type to set |
Zend_Measure_Exception |
setValue | ( | $value, | |
$type = null , |
|||
$locale = null |
|||
) |
Set a new value.
integer | string | $value | Value as string, integer, real or float |
string | $type | OPTIONAL A measure type f.e. Zend_Measure_Length::METER |
string | Zend_Locale | $locale | OPTIONAL Locale for parsing numbers |
Zend_Measure_Exception |
sub | ( | $object | ) |
Substracts an unit from another one.
Zend_Measure_Abstract | $object | object of same unit type |
toString | ( | $round = -1 , |
|
$locale = null |
|||
) |
Returns a string representation.
integer | $round | (Optional) Runds the value to an given exception |
string | Zend_Locale | $locale | (Optional) Locale to set for the number |
|
protected |
Locale identifier.
|
protected |
Original type for this unit.
|
protected |
Unit types for this measurement.
|
protected |
Plain value in standard unit.