BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
SMWQuantityValue Class Reference
Inheritance diagram for SMWQuantityValue:
Collaboration diagram for SMWQuantityValue:

Public Member Functions

 getUnitList ()
 
 getUnit ()
 
- Public Member Functions inherited from SMWNumberValue
 __construct ($typeid= '')
 
 parseNumberValue ($value, &$number, &$unit, &$asPrefix=false)
 
 setOutputFormat ($formatstring)
 
 getLocalizedFormattedNumber ($value)
 
 getNormalizedFormattedNumber ($value)
 
 getShortWikiText ($linker=null)
 
 getShortHTMLText ($linker=null)
 
 getLongWikiText ($linker=null)
 
 getLongHTMLText ($linker=null)
 
 getNumber ()
 
 getWikiValue ()
 
 getInfolinks ()
 
 getCanonicalMainUnit ()
 
 getConvertedUnitValues ()
 
 getUnit ()
 
 hasPrefixalUnitPreference ($unit)
 
 normalizeUnit ($unit)
 
 getUnitList ()
 
- Public Member Functions inherited from SMWDataValue
 __construct ($typeid)
 
 setUserValue ($value, $caption=false, $approximateValue=false)
 
 setDataItem (SMWDataItem $dataItem)
 
 setProperty (SMWDIProperty $property)
 
 getProperty ()
 
 setContextPage (SMWDIWikiPage $contextPage=null)
 
 getContextPage ()
 
 setOptions (Options $options)
 
 setOption ($key, $value)
 
 getOptionValueFor ($key)
 
 isEnabledFeature ($feature)
 
 setCaption ($caption)
 
 getCaption ()
 
 getPreferredCaption ()
 
 addInfolink (SMWInfolink $link)
 
 setOutputFormat ($formatString)
 
 getOutputFormat ()
 
 addError ($error)
 
 addErrorMsg ($parameters, $type=null, $language=null)
 
 clearErrors ()
 
 getQueryDescription ($value)
 
 getDataValueFormatter ()
 
 getPropertySpecificationLookup ()
 
 getDataItem ()
 
 __toString ()
 
 getShortWikiText ($linked=null)
 
 getShortHTMLText ($linker=null)
 
 getLongWikiText ($linked=null)
 
 getLongHTMLText ($linker=null)
 
 getShortText ($outputformat, $linker=null)
 
 getLongText ($outputformat, $linker=null)
 
 getInfolinkText ($outputformat, $linker=null)
 
 getWikiValue ()
 
 getTypeID ()
 
 disableServiceLinks ()
 
 getInfolinks ()
 
 getHash ()
 
 isNumeric ()
 
 isValid ()
 
 canUse ()
 
 setExtraneousFunctions (array $extraneousFunctions)
 
 getExtraneousFunctionFor ($name, array $parameters=array())
 
 getErrorText ()
 
 getErrors ()
 

Protected Member Functions

 convertToMainUnit ($number, $unit)
 
 makeConversionValues ()
 
 makeUserValue ()
 
 initConversionData ()
 
 initDisplayData ()
 
- Protected Member Functions inherited from SMWNumberValue
 parseUserValue ($value)
 
 loadDataItem (SMWDataItem $dataItem)
 
 getServiceLinkParams ()
 
 convertToMainUnit ($number, $unit)
 
 makeConversionValues ()
 
 makeUserValue ()
 
 getPreferredDisplayPrecision ()
 
- Protected Member Functions inherited from SMWDataValue
 parseUserValue ($value)
 
 loadDataItem (SMWDataItem $dataItem)
 
 getServiceLinkParams ()
 
 checkAllowedValues ()
 
 convertDoubleWidth ($value)
 

Protected Attributes

 $m_unitfactors = false
 
 $m_unitids = false
 
 $m_displayunits = false
 
 $m_mainunit = false
 
- Protected Attributes inherited from SMWNumberValue
 $m_unitvalues
 
 $prefixalUnitPreference = array()
 
 $m_unitin
 
 $precision = null
 
- Protected Attributes inherited from SMWDataValue
 $m_dataitem
 
 $m_property = null
 
 $m_contextPage = null
 
 $m_caption
 
 $m_typeid
 
 $m_outformat = false
 
 $approximateValue = false
 

Additional Inherited Members

- Static Public Member Functions inherited from SMWDataValue
static prepareValue (&$value, &$comparator)
 
- Public Attributes inherited from SMWDataValue
const OPT_USER_LANGUAGE = 'user.language'
 
const OPT_CONTENT_LANGUAGE = 'content.language'
 

Detailed Description

This datavalue implements unit support custom units, for which users have provided linear conversion factors within the wiki. Those user settings are retrieved from a property page associated with this object.

Author
Markus Krötzsch

Member Function Documentation

SMWQuantityValue::initConversionData ( )
protected

The remaining functions are relatively "private" but are kept protected since subclasses might exploit this to, e.g., "fake" conversion factors instead of getting them from the database. A cheap way of making built-in types. This method initializes $m_unitfactors, $m_unitids, and $m_mainunit.

SMWQuantityValue::initDisplayData ( )
protected

This method initializes $m_displayunits.

SMWQuantityValue::makeConversionValues ( )
protected

NOTE We keep non-ID units unless the input unit is used, so display units can be used to pick the preferred form of a unit. Doing this requires us to recompute the conversion values whenever the m_unitin changes.


The documentation for this class was generated from the following file: