Class for handling cooking volume conversions

category Zend
package Zend_Measure
subpackage Zend_Measure_Cooking_Volume
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Measure_Abstract

 Methods

Zend_Measure_Abstract is an abstract class for the different measurement types

__construct(mixed $value, integer $type = null, \Zend_Locale $locale = null
Inherited

Parameters

$value

mixed

Value as string, integer, real or float

$type

integer

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

$locale

\Zend_Locale

OPTIONAL a Zend_Locale Type

Exceptions

\Zend_Measure_Exception

Returns a string representation

__toString() : string
Inherited

Returns

string

Adds an unit to another one

add(\Zend_Measure_Abstract $object) : \Zend_Measure_Abstract
Inherited

Parameters

$object

\Zend_Measure_Abstract

object of same unit type

Returns

\Zend_Measure_Abstract

Compares two units

compare(\Zend_Measure_Abstract $object) : boolean
Inherited

Parameters

$object

\Zend_Measure_Abstract

object of same unit type

Returns

boolean

Alias function for setType returning the converted unit

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

Parameters

$type

string

Constant Type

$round

integer

(Optional) Rounds the value to a given precision

$locale

string\Zend_Locale

(Optional) Locale to set for the number

Returns

string

Compare if the value and type is equal

equals(\Zend_Measure_Abstract $object) : boolean
Inherited

Parameters

$object

\Zend_Measure_Abstract

object to compare

Returns

boolean

Returns the conversion list

getConversionList() : array
Inherited

Returns

array

Returns the actual set locale

getLocale() : string
Inherited

Returns

string

Returns the original type

getType() : \type
Inherited

Returns

\type

Returns the internal value

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

Parameters

$round

integer

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

$locale

string\Zend_Locale

(Optional) Locale for number representation

Returns

integerstring

Sets a new locale for the value representation

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

Parameters

$locale

string\Zend_Locale

(Optional) New locale to set

$check

boolean

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

Returns

\Zend_Measure_Abstract

Set a new type, and convert the value

setType(string $type) : \Zend_Measure_Abstract
Inherited

Parameters

$type

string

New type to set

Exceptions

\Zend_Measure_Exception

Returns

\Zend_Measure_Abstract

Set a new value

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

Parameters

$value

integerstring

Value as string, integer, real or float

$type

string

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

$locale

string\Zend_Locale

OPTIONAL Locale for parsing numbers

Exceptions

\Zend_Measure_Exception

Returns

\Zend_Measure_Abstract

Substracts an unit from another one

sub(\Zend_Measure_Abstract $object) : \Zend_Measure_Abstract
Inherited

Parameters

$object

\Zend_Measure_Abstract

object of same unit type

Returns

\Zend_Measure_Abstract

Returns a string representation

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

Parameters

$round

integer

(Optional) Runds the value to an given exception

$locale

string\Zend_Locale

(Optional) Locale to set for the number

Returns

string

 Properties

 

Locale identifier

$_locale : string

Default

null
 

Original type for this unit

$_type : string

Default

 

Calculations for all cooking volume units

$_units : array

Default

array('CAN_2POINT5' => array(array('' => '0.0037854118', '/' => '16', '' => '3.5'), '2.5th can'), 'CAN_10' => array(array('' => '0.0037854118', '*' => '0.75'), '10th can'), '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'), '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'), 'COFFEE_SPOON' => array(array('' => '0.0037854118', '/' => '1536'), 'coffee spoon'), 'CUBIC_CENTIMETER' => array('0.000001', 'cm³'), 'CUBIC_DECIMETER' => array('0.001', 'dm³'), 'CUBIC_FOOT' => array(array('' => '6.54119159', '/' => '231'), 'ft³'), 'CUBIC_INCH' => array(array('' => '0.0037854118', '/' => '231'), 'in³'), 'CUBIC_METER' => array('1', 'm³'), 'CUBIC_MICROMETER' => array('1.0e-18', 'µm³'), 'CUBIC_MILLIMETER' => array('1.0e-9', 'mm³'), 'CUP_CANADA' => array('0.0002273045', 'c'), 'CUP' => array('0.00025', 'c'), 'CUP_US' => array(array('' => '0.0037854118', '/' => '16'), 'c'), 'DASH' => array(array('' => '0.0037854118', '/' => '6144'), 'ds'), 'DECILITER' => array('0.0001', 'dl'), 'DEKALITER' => array('0.001', 'dal'), 'DEMI' => array('0.00025', 'demi'), 'DRAM' => array(array('' => '0.0037854118', '/' => '1024'), 'dr'), 'DROP' => array(array('' => '0.0037854118', '/' => '73728'), 'ggt'), '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'), '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'), 'PINCH' => array(array('' => '0.0037854118', '/' => '12288'), 'pinch'), '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'), 'SHOT' => array(array('' => '0.0037854118', '/' => '128'), 'shot'), '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'), 'STANDARD' => 'CUBIC_METER')
inherited_from \Zend_Measure_Abstract::_units
 

Unit types for this measurement

$_units 

Default

array()
 

Plain value in standard unit

$_value : string

Default

 Constants

 

BARREL

BARREL = 'BARREL' 
 

BARREL_US

BARREL_US = 'BARREL_US' 
 

BARREL_US_DRY

BARREL_US_DRY = 'BARREL_US_DRY' 
 

BARREL_US_FEDERAL

BARREL_US_FEDERAL = 'BARREL_US_FEDERAL' 
 

BARREL_WINE

BARREL_WINE = 'BARREL_WINE' 
 

BUCKET

BUCKET = 'BUCKET' 
 

BUCKET_US

BUCKET_US = 'BUCKET_US' 
 

BUSHEL

BUSHEL = 'BUSHEL' 
 

BUSHEL_US

BUSHEL_US = 'BUSHEL_US' 
 

CAN_10

CAN_10 = 'CAN_10' 
 

CAN_2POINT5

CAN_2POINT5 = 'CAN_2POINT5' 
 

CENTILITER

CENTILITER = 'CENTILITER' 
 

COFFEE_SPOON

COFFEE_SPOON = 'COFFEE_SPOON' 
 

CUBIC_CENTIMETER

CUBIC_CENTIMETER = 'CUBIC_CENTIMETER' 
 

CUBIC_DECIMETER

CUBIC_DECIMETER = 'CUBIC_DECIMETER' 
 

CUBIC_FOOT

CUBIC_FOOT = 'CUBIC_FOOT' 
 

CUBIC_INCH

CUBIC_INCH = 'CUBIC_INCH' 
 

CUBIC_METER

CUBIC_METER = 'CUBIC_METER' 
 

CUBIC_MICROMETER

CUBIC_MICROMETER = 'CUBIC_MICROMETER' 
 

CUBIC_MILLIMETER

CUBIC_MILLIMETER = 'CUBIC_MILLIMETER' 
 

CUP

CUP = 'CUP' 
 

CUP_CANADA

CUP_CANADA = 'CUP_CANADA' 
 

CUP_US

CUP_US = 'CUP_US' 
 

DASH

DASH = 'DASH' 
 

DECILITER

DECILITER = 'DECILITER' 
 

DEKALITER

DEKALITER = 'DEKALITER' 
 

DEMI

DEMI = 'DEMI' 
 

DRAM

DRAM = 'DRAM' 
 

DROP

DROP = 'DROP' 
 

FIFTH

FIFTH = 'FIFTH' 
 

GALLON

GALLON = 'GALLON' 
 

GALLON_US

GALLON_US = 'GALLON_US' 
 

GALLON_US_DRY

GALLON_US_DRY = 'GALLON_US_DRY' 
 

GILL

GILL = 'GILL' 
 

GILL_US

GILL_US = 'GILL_US' 
 

HECTOLITER

HECTOLITER = 'HECTOLITER' 
 

HOGSHEAD

HOGSHEAD = 'HOGSHEAD' 
 

HOGSHEAD_US

HOGSHEAD_US = 'HOGSHEAD_US' 
 

JIGGER

JIGGER = 'JIGGER' 
 

KILOLITER

KILOLITER = 'KILOLITER' 
 

LITER

LITER = 'LITER' 
 

MEASURE

MEASURE = 'MEASURE' 
 

MEGALITER

MEGALITER = 'MEGALITER' 
 

MICROLITER

MICROLITER = 'MICROLITER' 
 

MILLILITER

MILLILITER = 'MILLILITER' 
 

MINIM

MINIM = 'MINIM' 
 

MINIM_US

MINIM_US = 'MINIM_US' 
 

OUNCE

OUNCE = 'OUNCE' 
 

OUNCE_US

OUNCE_US = 'OUNCE_US' 
 

PECK

PECK = 'PECK' 
 

PECK_US

PECK_US = 'PECK_US' 
 

PINCH

PINCH = 'PINCH' 
 

PINT

PINT = 'PINT' 
 

PINT_US

PINT_US = 'PINT_US' 
 

PINT_US_DRY

PINT_US_DRY = 'PINT_US_DRY' 
 

PIPE

PIPE = 'PIPE' 
 

PIPE_US

PIPE_US = 'PIPE_US' 
 

PONY

PONY = 'PONY' 
 

QUART

QUART = 'QUART' 
 

QUART_ANCIENT

QUART_ANCIENT = 'QUART_ANCIENT' 
 

QUART_GERMANY

QUART_GERMANY = 'QUART_GERMANY' 
 

QUART_US

QUART_US = 'QUART_US' 
 

QUART_US_DRY

QUART_US_DRY = 'QUART_US_DRY' 
 

SHOT

SHOT = 'SHOT' 
 

STANDARD

STANDARD = 'CUBIC_METER' 
 

TABLESPOON

TABLESPOON = 'TABLESPOON' 
 

TABLESPOON_UK

TABLESPOON_UK = 'TABLESPOON_UK' 
 

TABLESPOON_US

TABLESPOON_US = 'TABLESPOON_US' 
 

TEASPOON

TEASPOON = 'TEASPOON' 
 

TEASPOON_UK

TEASPOON_UK = 'TEASPOON_UK' 
 

TEASPOON_US

TEASPOON_US = 'TEASPOON_US'