API Documentation

Measure/Abstract.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Measure
version
$Id: Abstract.php 21330 2010-03-04 22:07:38Z thomas $
Classes
Zend_Measure_Abstract

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Measure_Abstract

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Measure
subpackage
Zend_Measure_Abstract
Properties
$_value
$_type
$_locale
$_units
Methods
__construct
getLocale
setLocale
getValue
setValue
getType
setType
equals
toString
__toString
getConversionList
convertTo
add
sub
compare

Description

Abstract class for all measurements

Properties

$_locale

string $_locale = 'null'

Locale identifier

Details

$_locale
string
visibility
protected
default
null
final
false
static
false

$_type

string $_type = ''

Original type for this unit

Details

$_type
string
visibility
protected
default
final
false
static
false

$_units

 $_units = 'array'

Unit types for this measurement

Details

visibility
protected
default
array
final
false
static
false

$_value

string $_value = ''

Plain value in standard unit

Details

$_value
string
visibility
protected
default
final
false
static
false

Methods

__construct

__construct( $value $value, $type $type = null, $locale $locale = null ) :

Zend_Measure_Abstract is an abstract class for the different measurement types

Arguments
$value
$value
mixed - Value as string, integer, real or float
$type
$type
type - OPTIONAL a measure type f.e. Zend_Measure_Length::METER
$locale
$locale
locale - OPTIONAL a Zend_Locale Type
Details
visibility
public
final
false
static
false
throws

__toString

__toString( ) : string

Returns a string representation

Output
string
Details
visibility
public
final
false
static
false

add

add( Zend_Measure_Abstract $object ) : Zend_Measure_Abstract

Adds an unit to another one

Arguments
$object
Zend_Measure_Abstract
object of same unit type
Details
visibility
public
final
false
static
false

compare

compare( Zend_Measure_Abstract $object ) : boolean

Compares two units

Arguments
$object
Zend_Measure_Abstract
object of same unit type
Output
boolean
Details
visibility
public
final
false
static
false

convertTo

convertTo( string $type, integer $round = 2, string|Zend_Locale $locale = null ) : string

Alias function for setType returning the converted unit

Arguments
$type
string
Constant Type
$round
integer
(Optional) Rounds the value to a given precision
$locale
stringZend_Locale
(Optional) Locale to set for the number
Output
string
Details
visibility
public
final
false
static
false

equals

equals( Zend_Measure_Abstract $object ) : boolean

Compare if the value and type is equal

Arguments
$object
Zend_Measure_Abstract
object to compare
Output
boolean
Details
visibility
public
final
false
static
false

getConversionList

getConversionList( ) : array

Returns the conversion list

Output
array
Details
visibility
public
final
false
static
false

getLocale

getLocale( ) : string

Returns the actual set locale

Output
string
Details
visibility
public
final
false
static
false

getType

getType( ) : type

Returns the original type

Output
type
Details
visibility
public
final
false
static
false

getValue

getValue( integer $round = 1, string|Zend_Locale $locale = null ) : integer|string

Returns the internal value

Arguments
$round
integer
(Optional) Rounds the value to an given precision, Default is -1 which returns without rounding
$locale
stringZend_Locale
(Optional) Locale for number representation
Output
integer|string
Details
visibility
public
final
false
static
false

setLocale

setLocale( string|Zend_Locale $locale = null, boolean $check = false ) : Zend_Measure_Abstract

Sets a new locale for the value representation

Arguments
$locale
stringZend_Locale
(Optional) New locale to set
$check
boolean
False, check but don't set; True, set the new locale
Details
visibility
public
final
false
static
false

setType

setType( string $type ) : Zend_Measure_Abstract

Set a new type, and convert the value

Arguments
$type
string
New type to set
Details
visibility
public
final
false
static
false
throws

setValue

setValue( integer|string $value, string $type = null, string|Zend_Locale $locale = null ) : Zend_Measure_Abstract

Set a new value

Arguments
$value
integerstring
Value as string, integer, real or float
$type
string
OPTIONAL A measure type f.e. Zend_Measure_Length::METER
$locale
stringZend_Locale
OPTIONAL Locale for parsing numbers
Details
visibility
public
final
false
static
false
throws

sub

sub( Zend_Measure_Abstract $object ) : Zend_Measure_Abstract

Substracts an unit from another one

Arguments
$object
Zend_Measure_Abstract
object of same unit type
Details
visibility
public
final
false
static
false

toString

toString( integer $round = 1, string|Zend_Locale $locale = null ) : string

Returns a string representation

Arguments
$round
integer
(Optional) Runds the value to an given exception
$locale
stringZend_Locale
(Optional) Locale to set for the number
Output
string
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.