Measure/Torque.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: Torque.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Measure_Torque

Package: Zend\Measure\Zend\Measure\Torque
Class for handling torque 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 = 'NEWTON_METER'
>VConstant  DYNE_CENTIMETER = 'DYNE_CENTIMETER'
>VConstant  GRAM_CENTIMETER = 'GRAM_CENTIMETER'
>VConstant  KILOGRAM_CENTIMETER = 'KILOGRAM_CENTIMETER'
>VConstant  KILOGRAM_METER = 'KILOGRAM_METER'
>VConstant  KILONEWTON_METER = 'KILONEWTON_METER'
>VConstant  KILOPOND_METER = 'KILOPOND_METER'
>VConstant  MEGANEWTON_METER = 'MEGANEWTON_METER'
>VConstant  MICRONEWTON_METER = 'MICRONEWTON_METER'
>VConstant  MILLINEWTON_METER = 'MILLINEWTON_METER'
>VConstant  NEWTON_CENTIMETER = 'NEWTON_CENTIMETER'
>VConstant  NEWTON_METER = 'NEWTON_METER'
>VConstant  OUNCE_FOOT = 'OUNCE_FOOT'
>VConstant  OUNCE_INCH = 'OUNCE_INCH'
>VConstant  POUND_FOOT = 'POUND_FOOT'
>VConstant  POUNDAL_FOOT = 'POUNDAL_FOOT'
>VConstant  POUND_INCH = 'POUND_INCH'

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('DYNE_CENTIMETER' => array('0.0000001', 'dyncm'), 'GRAM_CENTIMETER' => array('0.0000980665', 'gcm'), 'KILOGRAM_CENTIMETER' => array('0.0980665', 'kgcm'), 'KILOGRAM_METER' => array('9.80665', 'kgm'), 'KILONEWTON_METER' => array('1000', 'kNm'), 'KILOPOND_METER' => array('9.80665', 'kpm'), 'MEGANEWTON_METER' => array('1000000', 'MNm'), 'MICRONEWTON_METER' => array('0.000001', 'µNm'), 'MILLINEWTON_METER' => array('0.001', 'mNm'), 'NEWTON_CENTIMETER' => array('0.01', 'Ncm'), 'NEWTON_METER' => array('1', 'Nm'), 'OUNCE_FOOT' => array('0.084738622', 'ozft'), 'OUNCE_INCH' => array(array('' => '0.084738622', '/' => '12'), 'ozin'), 'POUND_FOOT' => array(array('' => '0.084738622', '*' => '16'), 'lbft'), 'POUNDAL_FOOT' => array('0.0421401099752144', 'plft'), 'POUND_INCH' => array(array('' => '0.084738622', '/' => '12', '*' => '16'), 'lbin'), 'STANDARD' => 'NEWTON_METER')
Calculations for all torque units
Default valuearray('DYNE_CENTIMETER' => array('0.0000001', 'dyncm'), 'GRAM_CENTIMETER' => array('0.0000980665', 'gcm'), 'KILOGRAM_CENTIMETER' => array('0.0980665', 'kgcm'), 'KILOGRAM_METER' => array('9.80665', 'kgm'), 'KILONEWTON_METER' => array('1000', 'kNm'), 'KILOPOND_METER' => array('9.80665', 'kpm'), 'MEGANEWTON_METER' => array('1000000', 'MNm'), 'MICRONEWTON_METER' => array('0.000001', 'µNm'), 'MILLINEWTON_METER' => array('0.001', 'mNm'), 'NEWTON_CENTIMETER' => array('0.01', 'Ncm'), 'NEWTON_METER' => array('1', 'Nm'), 'OUNCE_FOOT' => array('0.084738622', 'ozft'), 'OUNCE_INCH' => array(array('' => '0.084738622', '/' => '12'), 'ozin'), 'POUND_FOOT' => array(array('' => '0.084738622', '*' => '16'), 'lbft'), 'POUNDAL_FOOT' => array('0.0421401099752144', 'plft'), 'POUND_INCH' => array(array('' => '0.084738622', '/' => '12', '*' => '16'), 'lbin'), 'STANDARD' => 'NEWTON_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.