Measure/Volume.php

Show: PublicProtectedPrivateinherited
Table of Contents
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.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Measure  
Version
$Id: Volume.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Measure_Volume

Package: Zend\Measure\Zend\Measure\Volume
Class for handling acceleration conversions
Parent(s)
\Zend_Measure_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  STANDARD = 'CUBIC_METER'
>VConstant  ACRE_FOOT = 'ACRE_FOOT'
>VConstant  ACRE_FOOT_SURVEY = 'ACRE_FOOT_SURVEY'
>VConstant  ACRE_INCH = 'ACRE_INCH'
>VConstant  BARREL_WINE = 'BARREL_WINE'
>VConstant  BARREL = 'BARREL'
>VConstant  BARREL_US_DRY = 'BARREL_US_DRY'
>VConstant  BARREL_US_FEDERAL = 'BARREL_US_FEDERAL'
>VConstant  BARREL_US = 'BARREL_US'
>VConstant  BARREL_US_PETROLEUM = 'BARREL_US_PETROLEUM'
>VConstant  BOARD_FOOT = 'BOARD_FOOT'
>VConstant  BUCKET = 'BUCKET'
>VConstant  BUCKET_US = 'BUCKET_US'
>VConstant  BUSHEL = 'BUSHEL'
>VConstant  BUSHEL_US = 'BUSHEL_US'
>VConstant  CENTILTER = 'CENTILITER'
>VConstant  CORD = 'CORD'
>VConstant  CORD_FOOT = 'CORD_FOOT'
>VConstant  CUBIC_CENTIMETER = 'CUBIC_CENTIMETER'
>VConstant  CUBIC_CUBIT = 'CUBIC_CUBIT'
>VConstant  CUBIC_DECIMETER = 'CUBIC_DECIMETER'
>VConstant  CUBIC_DEKAMETER = 'CUBIC_DEKAMETER'
>VConstant  CUBIC_FOOT = 'CUBIC_FOOT'
>VConstant  CUBIC_INCH = 'CUBIC_INCH'
>VConstant  CUBIC_KILOMETER = 'CUBIC_KILOMETER'
>VConstant  CUBIC_METER = 'CUBIC_METER'
>VConstant  CUBIC_MILE = 'CUBIC_MILE'
>VConstant  CUBIC_MICROMETER = 'CUBIC_MICROMETER'
>VConstant  CUBIC_MILLIMETER = 'CUBIC_MILLIMETER'
>VConstant  CUBIC_YARD = 'CUBIC_YARD'
>VConstant  CUP_CANADA = 'CUP_CANADA'
>VConstant  CUP = 'CUP'
>VConstant  CUP_US = 'CUP_US'
>VConstant  DECILITER = 'DECILITER'
>VConstant  DEKALITER = 'DEKALITER'
>VConstant  DRAM = 'DRAM'
>VConstant  DRUM_US = 'DRUM_US'
>VConstant  DRUM = 'DRUM'
>VConstant  FIFTH = 'FIFTH'
>VConstant  GALLON = 'GALLON'
>VConstant  GALLON_US_DRY = 'GALLON_US_DRY'
>VConstant  GALLON_US = 'GALLON_US'
>VConstant  GILL = 'GILL'
>VConstant  GILL_US = 'GILL_US'
>VConstant  HECTARE_METER = 'HECTARE_METER'
>VConstant  HECTOLITER = 'HECTOLITER'
>VConstant  HOGSHEAD = 'HOGSHEAD'
>VConstant  HOGSHEAD_US = 'HOGSHEAD_US'
>VConstant  JIGGER = 'JIGGER'
>VConstant  KILOLITER = 'KILOLITER'
>VConstant  LITER = 'LITER'
>VConstant  MEASURE = 'MEASURE'
>VConstant  MEGALITER = 'MEGALITER'
>VConstant  MICROLITER = 'MICROLITER'
>VConstant  MILLILITER = 'MILLILITER'
>VConstant  MINIM = 'MINIM'
>VConstant  MINIM_US = 'MINIM_US'
>VConstant  OUNCE = 'OUNCE'
>VConstant  OUNCE_US = 'OUNCE_US'
>VConstant  PECK = 'PECK'
>VConstant  PECK_US = 'PECK_US'
>VConstant  PINT = 'PINT'
>VConstant  PINT_US_DRY = 'PINT_US_DRY'
>VConstant  PINT_US = 'PINT_US'
>VConstant  PIPE = 'PIPE'
>VConstant  PIPE_US = 'PIPE_US'
>VConstant  PONY = 'PONY'
>VConstant  QUART_GERMANY = 'QUART_GERMANY'
>VConstant  QUART_ANCIENT = 'QUART_ANCIENT'
>VConstant  QUART = 'QUART'
>VConstant  QUART_US_DRY = 'QUART_US_DRY'
>VConstant  QUART_US = 'QUART_US'
>VConstant  QUART_UK = 'QUART_UK'
>VConstant  SHOT = 'SHOT'
>VConstant  STERE = 'STERE'
>VConstant  TABLESPOON = 'TABLESPOON'
>VConstant  TABLESPOON_UK = 'TABLESPOON_UK'
>VConstant  TABLESPOON_US = 'TABLESPOON_US'
>VConstant  TEASPOON = 'TEASPOON'
>VConstant  TEASPOON_UK = 'TEASPOON_UK'
>VConstant  TEASPOON_US = 'TEASPOON_US'
>VConstant  YARD = 'YARD'

Properties

>VPropertyprotectedstring $_locale = null
inherited
Locale identifier
Inherited from: \Zend_Measure_Abstract::$$_locale
Default valuenullDetails
Type
string
Inherited_from
\Zend_Measure_Abstract::$$_locale  
>VPropertyprotectedstring $_type
inherited
Original type for this unit
Inherited from: \Zend_Measure_Abstract::$$_type
Details
Type
string
Inherited_from
\Zend_Measure_Abstract::$$_type  
>VPropertyprotectedarray $_units = array('ACRE_FOOT' => array('1233.48185532', 'ac ft'), 'ACRE_FOOT_SURVEY' => array('1233.489', 'ac ft'), 'ACRE_INCH' => array('102.79015461', 'ac in'), 'BARREL_WINE' => array('0.143201835', 'bbl'), 'BARREL' => array('0.16365924', 'bbl'), 'BARREL_US_DRY' => array(array('' => '26.7098656608', '/' => '231'), 'bbl'), 'BARREL_US_FEDERAL' => array('0.1173477658', 'bbl'), 'BARREL_US' => array('0.1192404717', 'bbl'), 'BARREL_US_PETROLEUM' => array('0.1589872956', 'bbl'), 'BOARD_FOOT' => array(array('' => '6.5411915904', '/' => '2772'), 'board foot'), 'BUCKET' => array('0.01818436', 'bucket'), 'BUCKET_US' => array('0.018927059', 'bucket'), 'BUSHEL' => array('0.03636872', 'bu'), 'BUSHEL_US' => array('0.03523907', 'bu'), 'CENTILITER' => array('0.00001', 'cl'), 'CORD' => array('3.624556416', 'cd'), 'CORD_FOOT' => array('0.453069552', 'cd ft'), 'CUBIC_CENTIMETER' => array('0.000001', 'cm³'), 'CUBIC_CUBIT' => array('0.144', 'cubit³'), 'CUBIC_DECIMETER' => array('0.001', 'dm³'), 'CUBIC_DEKAMETER' => array('1000', 'dam³'), 'CUBIC_FOOT' => array(array('' => '6.54119159', '/' => '231'), 'ft³'), 'CUBIC_INCH' => array(array('' => '0.0037854118', '/' => '231'), 'in³'), 'CUBIC_KILOMETER' => array('1.0e+9', 'km³'), 'CUBIC_METER' => array('1', 'm³'), 'CUBIC_MILE' => array(array('' => '0.0037854118', '/' => '231', '*' => '75271680', '*' => '3379200'), 'mi³'), 'CUBIC_MICROMETER' => array('1.0e-18', 'µm³'), 'CUBIC_MILLIMETER' => array('1.0e-9', 'mm³'), 'CUBIC_YARD' => array(array('' => '0.0037854118', '/' => '231', '*' => '46656'), 'yd³'), 'CUP_CANADA' => array('0.0002273045', 'c'), 'CUP' => array('0.00025', 'c'), 'CUP_US' => array(array('' => '0.0037854118', '/' => '16'), 'c'), 'DECILITER' => array('0.0001', 'dl'), 'DEKALITER' => array('0.001', 'dal'), 'DRAM' => array(array('' => '0.0037854118', '/' => '1024'), 'dr'), 'DRUM_US' => array('0.208197649', 'drum'), 'DRUM' => array('0.2', 'drum'), 'FIFTH' => array('0.00075708236', 'fifth'), 'GALLON' => array('0.00454609', 'gal'), 'GALLON_US_DRY' => array('0.0044048838', 'gal'), 'GALLON_US' => array('0.0037854118', 'gal'), 'GILL' => array(array('' => '0.00454609', '/' => '32'), 'gi'), 'GILL_US' => array(array('' => '0.0037854118', '/' => '32'), 'gi'), 'HECTARE_METER' => array('10000', 'ha m'), 'HECTOLITER' => array('0.1', 'hl'), 'HOGSHEAD' => array('0.28640367', 'hhd'), 'HOGSHEAD_US' => array('0.2384809434', 'hhd'), 'JIGGER' => array(array('' => '0.0037854118', '/' => '128', '*' => '1.5'), 'jigger'), 'KILOLITER' => array('1', 'kl'), 'LITER' => array('0.001', 'l'), 'MEASURE' => array('0.0077', 'measure'), 'MEGALITER' => array('1000', 'Ml'), 'MICROLITER' => array('1.0e-9', 'µl'), 'MILLILITER' => array('0.000001', 'ml'), 'MINIM' => array(array('' => '0.00454609', '/' => '76800'), 'min'), 'MINIM_US' => array(array('' => '0.0037854118', '/' => '61440'), 'min'), 'OUNCE' => array(array('' => '0.00454609', '/' => '160'), 'oz'), 'OUNCE_US' => array(array('' => '0.0037854118', '/' => '128'), 'oz'), 'PECK' => array('0.00909218', 'pk'), 'PECK_US' => array('0.0088097676', 'pk'), 'PINT' => array(array('' => '0.00454609', '/' => '8'), 'pt'), 'PINT_US_DRY' => array(array('' => '0.0044048838', '/' => '8'), 'pt'), 'PINT_US' => array(array('' => '0.0037854118', '/' => '8'), 'pt'), 'PIPE' => array('0.49097772', 'pipe'), 'PIPE_US' => array('0.4769618868', 'pipe'), 'PONY' => array(array('' => '0.0037854118', '/' => '128'), 'pony'), 'QUART_GERMANY' => array('0.00114504', 'qt'), 'QUART_ANCIENT' => array('0.00108', 'qt'), 'QUART' => array(array('' => '0.00454609', '/' => '4'), 'qt'), 'QUART_US_DRY' => array(array('' => '0.0044048838', '/' => '4'), 'qt'), 'QUART_US' => array(array('' => '0.0037854118', '/' => '4'), 'qt'), 'QUART_UK' => array('0.29094976', 'qt'), 'SHOT' => array(array('' => '0.0037854118', '/' => '128'), 'shot'), 'STERE' => array('1', 'st'), 'TABLESPOON' => array('0.000015', 'tbsp'), 'TABLESPOON_UK' => array(array('' => '0.00454609', '/' => '320'), 'tbsp'), 'TABLESPOON_US' => array(array('' => '0.0037854118', '/' => '256'), 'tbsp'), 'TEASPOON' => array('0.000005', 'tsp'), 'TEASPOON_UK' => array(array('' => '0.00454609', '/' => '1280'), 'tsp'), 'TEASPOON_US' => array(array('' => '0.0037854118', '/' => '768'), 'tsp'), 'YARD' => array(array('' => '176.6121729408', '/' => '231'), 'yd'), 'STANDARD' => 'CUBIC_METER')
Calculations for all volume units
Default valuearray('ACRE_FOOT' => array('1233.48185532', 'ac ft'), 'ACRE_FOOT_SURVEY' => array('1233.489', 'ac ft'), 'ACRE_INCH' => array('102.79015461', 'ac in'), 'BARREL_WINE' => array('0.143201835', 'bbl'), 'BARREL' => array('0.16365924', 'bbl'), 'BARREL_US_DRY' => array(array('' => '26.7098656608', '/' => '231'), 'bbl'), 'BARREL_US_FEDERAL' => array('0.1173477658', 'bbl'), 'BARREL_US' => array('0.1192404717', 'bbl'), 'BARREL_US_PETROLEUM' => array('0.1589872956', 'bbl'), 'BOARD_FOOT' => array(array('' => '6.5411915904', '/' => '2772'), 'board foot'), 'BUCKET' => array('0.01818436', 'bucket'), 'BUCKET_US' => array('0.018927059', 'bucket'), 'BUSHEL' => array('0.03636872', 'bu'), 'BUSHEL_US' => array('0.03523907', 'bu'), 'CENTILITER' => array('0.00001', 'cl'), 'CORD' => array('3.624556416', 'cd'), 'CORD_FOOT' => array('0.453069552', 'cd ft'), 'CUBIC_CENTIMETER' => array('0.000001', 'cm³'), 'CUBIC_CUBIT' => array('0.144', 'cubit³'), 'CUBIC_DECIMETER' => array('0.001', 'dm³'), 'CUBIC_DEKAMETER' => array('1000', 'dam³'), 'CUBIC_FOOT' => array(array('' => '6.54119159', '/' => '231'), 'ft³'), 'CUBIC_INCH' => array(array('' => '0.0037854118', '/' => '231'), 'in³'), 'CUBIC_KILOMETER' => array('1.0e+9', 'km³'), 'CUBIC_METER' => array('1', 'm³'), 'CUBIC_MILE' => array(array('' => '0.0037854118', '/' => '231', '*' => '75271680', '*' => '3379200'), 'mi³'), 'CUBIC_MICROMETER' => array('1.0e-18', 'µm³'), 'CUBIC_MILLIMETER' => array('1.0e-9', 'mm³'), 'CUBIC_YARD' => array(array('' => '0.0037854118', '/' => '231', '*' => '46656'), 'yd³'), 'CUP_CANADA' => array('0.0002273045', 'c'), 'CUP' => array('0.00025', 'c'), 'CUP_US' => array(array('' => '0.0037854118', '/' => '16'), 'c'), 'DECILITER' => array('0.0001', 'dl'), 'DEKALITER' => array('0.001', 'dal'), 'DRAM' => array(array('' => '0.0037854118', '/' => '1024'), 'dr'), 'DRUM_US' => array('0.208197649', 'drum'), 'DRUM' => array('0.2', 'drum'), 'FIFTH' => array('0.00075708236', 'fifth'), 'GALLON' => array('0.00454609', 'gal'), 'GALLON_US_DRY' => array('0.0044048838', 'gal'), 'GALLON_US' => array('0.0037854118', 'gal'), 'GILL' => array(array('' => '0.00454609', '/' => '32'), 'gi'), 'GILL_US' => array(array('' => '0.0037854118', '/' => '32'), 'gi'), 'HECTARE_METER' => array('10000', 'ha m'), 'HECTOLITER' => array('0.1', 'hl'), 'HOGSHEAD' => array('0.28640367', 'hhd'), 'HOGSHEAD_US' => array('0.2384809434', 'hhd'), 'JIGGER' => array(array('' => '0.0037854118', '/' => '128', '*' => '1.5'), 'jigger'), 'KILOLITER' => array('1', 'kl'), 'LITER' => array('0.001', 'l'), 'MEASURE' => array('0.0077', 'measure'), 'MEGALITER' => array('1000', 'Ml'), 'MICROLITER' => array('1.0e-9', 'µl'), 'MILLILITER' => array('0.000001', 'ml'), 'MINIM' => array(array('' => '0.00454609', '/' => '76800'), 'min'), 'MINIM_US' => array(array('' => '0.0037854118', '/' => '61440'), 'min'), 'OUNCE' => array(array('' => '0.00454609', '/' => '160'), 'oz'), 'OUNCE_US' => array(array('' => '0.0037854118', '/' => '128'), 'oz'), 'PECK' => array('0.00909218', 'pk'), 'PECK_US' => array('0.0088097676', 'pk'), 'PINT' => array(array('' => '0.00454609', '/' => '8'), 'pt'), 'PINT_US_DRY' => array(array('' => '0.0044048838', '/' => '8'), 'pt'), 'PINT_US' => array(array('' => '0.0037854118', '/' => '8'), 'pt'), 'PIPE' => array('0.49097772', 'pipe'), 'PIPE_US' => array('0.4769618868', 'pipe'), 'PONY' => array(array('' => '0.0037854118', '/' => '128'), 'pony'), 'QUART_GERMANY' => array('0.00114504', 'qt'), 'QUART_ANCIENT' => array('0.00108', 'qt'), 'QUART' => array(array('' => '0.00454609', '/' => '4'), 'qt'), 'QUART_US_DRY' => array(array('' => '0.0044048838', '/' => '4'), 'qt'), 'QUART_US' => array(array('' => '0.0037854118', '/' => '4'), 'qt'), 'QUART_UK' => array('0.29094976', 'qt'), 'SHOT' => array(array('' => '0.0037854118', '/' => '128'), 'shot'), 'STERE' => array('1', 'st'), 'TABLESPOON' => array('0.000015', 'tbsp'), 'TABLESPOON_UK' => array(array('' => '0.00454609', '/' => '320'), 'tbsp'), 'TABLESPOON_US' => array(array('' => '0.0037854118', '/' => '256'), 'tbsp'), 'TEASPOON' => array('0.000005', 'tsp'), 'TEASPOON_UK' => array(array('' => '0.00454609', '/' => '1280'), 'tsp'), 'TEASPOON_US' => array(array('' => '0.0037854118', '/' => '768'), 'tsp'), 'YARD' => array(array('' => '176.6121729408', '/' => '231'), 'yd'), 'STANDARD' => 'CUBIC_METER')Details
Type
array
>VPropertyprotectedstring $_value
inherited
Plain value in standard unit
Inherited from: \Zend_Measure_Abstract::$$_value
Details
Type
string
Inherited_from
\Zend_Measure_Abstract::$$_value  

Methods

methodpublic__construct(mixed $value, int $type = null, \Zend_Locale $locale = null) : void
inherited

Zend_Measure_Abstract is an abstract class for the different measurement types

Inherited from: \Zend_Measure_Abstract::__construct()
Parameters
NameTypeDescription
$valuemixed

Value as string, integer, real or float

$typeint

OPTIONAL a measure type f.e. Zend_Measure_Length::METER

$locale\Zend_Locale

OPTIONAL a Zend_Locale Type

Throws
ExceptionDescription
\Zend_Measure_Exception
methodpublic__toString() : string
inherited

Returns a string representation

Inherited from: \Zend_Measure_Abstract::__toString()
Returns
TypeDescription
string
methodpublicadd(\Zend_Measure_Abstract $object) : \Zend_Measure_Abstract
inherited

Adds an unit to another one

Inherited from: \Zend_Measure_Abstract::add()
Parameters
NameTypeDescription
$object\Zend_Measure_Abstract

object of same unit type

Returns
TypeDescription
\Zend_Measure_Abstract
methodpubliccompare(\Zend_Measure_Abstract $object) : boolean
inherited

Compares two units

Inherited from: \Zend_Measure_Abstract::compare()
Parameters
NameTypeDescription
$object\Zend_Measure_Abstract

object of same unit type

Returns
TypeDescription
boolean
methodpublicconvertTo(string $type, integer $round = 2, string | \Zend_Locale $locale = null) : string
inherited

Alias function for setType returning the converted unit

Inherited from: \Zend_Measure_Abstract::convertTo()
Parameters
NameTypeDescription
$typestring

Constant Type

$roundinteger

(Optional) Rounds the value to a given precision

$localestring | \Zend_Locale

(Optional) Locale to set for the number

Returns
TypeDescription
string
methodpublicequals(\Zend_Measure_Abstract $object) : boolean
inherited

Compare if the value and type is equal

Inherited from: \Zend_Measure_Abstract::equals()
Parameters
NameTypeDescription
$object\Zend_Measure_Abstract

object to compare

Returns
TypeDescription
boolean
methodpublicgetConversionList() : array
inherited

Returns the conversion list

Inherited from: \Zend_Measure_Abstract::getConversionList()
Returns
TypeDescription
array
methodpublicgetLocale() : string
inherited

Returns the actual set locale

Inherited from: \Zend_Measure_Abstract::getLocale()
Returns
TypeDescription
string
methodpublicgetType() : \type
inherited

Returns the original type

Inherited from: \Zend_Measure_Abstract::getType()
Returns
TypeDescription
\type
methodpublicgetValue(integer $round = -1, string | \Zend_Locale $locale = null) : integer | string
inherited

Returns the internal value

Inherited from: \Zend_Measure_Abstract::getValue()
Parameters
NameTypeDescription
$roundinteger

(Optional) Rounds the value to an given precision, Default is -1 which returns without rounding

$localestring | \Zend_Locale

(Optional) Locale for number representation

Returns
TypeDescription
integer | string
methodpublicsetLocale(string | \Zend_Locale $locale = null, boolean $check = false) : \Zend_Measure_Abstract
inherited

Sets a new locale for the value representation

Inherited from: \Zend_Measure_Abstract::setLocale()
Parameters
NameTypeDescription
$localestring | \Zend_Locale

(Optional) New locale to set

$checkboolean

False, check but don't set; True, set the new locale

Returns
TypeDescription
\Zend_Measure_Abstract
methodpublicsetType(string $type) : \Zend_Measure_Abstract
inherited

Set a new type, and convert the value

Inherited from: \Zend_Measure_Abstract::setType()
Parameters
NameTypeDescription
$typestring

New type to set

Returns
TypeDescription
\Zend_Measure_Abstract
Throws
ExceptionDescription
\Zend_Measure_Exception
methodpublicsetValue(integer | string $value, string $type = null, string | \Zend_Locale $locale = null) : \Zend_Measure_Abstract
inherited

Set a new value

Inherited from: \Zend_Measure_Abstract::setValue()
Parameters
NameTypeDescription
$valueinteger | string

Value as string, integer, real or float

$typestring

OPTIONAL A measure type f.e. Zend_Measure_Length::METER

$localestring | \Zend_Locale

OPTIONAL Locale for parsing numbers

Returns
TypeDescription
\Zend_Measure_Abstract
Throws
ExceptionDescription
\Zend_Measure_Exception
methodpublicsub(\Zend_Measure_Abstract $object) : \Zend_Measure_Abstract
inherited

Substracts an unit from another one

Inherited from: \Zend_Measure_Abstract::sub()
Parameters
NameTypeDescription
$object\Zend_Measure_Abstract

object of same unit type

Returns
TypeDescription
\Zend_Measure_Abstract
methodpublictoString(integer $round = -1, string | \Zend_Locale $locale = null) : string
inherited

Returns a string representation

Inherited from: \Zend_Measure_Abstract::toString()
Parameters
NameTypeDescription
$roundinteger

(Optional) Runds the value to an given exception

$localestring | \Zend_Locale

(Optional) Locale to set for the number

Returns
TypeDescription
string
Documentation was generated by phpDocumentor 2.0.0a12.