Wikibase
MediaWiki Wikibase extension
Wikibase\Lib\Units\UnitStorage Interface Reference

Storage interface for Unit conversion information. More...

+ Inheritance diagram for Wikibase\Lib\Units\UnitStorage:

Public Member Functions

 isPrimaryUnit ( $unit)
 Check if the unit is primary. More...
 
 getConversion ( $unit)
 Get conversion from this unit to primary unit. More...
 

Detailed Description

Storage interface for Unit conversion information.

Author
Stas Malyshev

Member Function Documentation

◆ getConversion()

Wikibase\Lib\Units\UnitStorage::getConversion (   $unit)

Get conversion from this unit to primary unit.

Parameters
string$unit
Returns
array|null [ 'factor'=>$quantity, 'unit'=>$targetUnit ] or null if no conversion available or needed

Implemented in Wikibase\Lib\Units\BaseUnitStorage.

◆ isPrimaryUnit()

Wikibase\Lib\Units\UnitStorage::isPrimaryUnit (   $unit)

Check if the unit is primary.

Parameters
string$unit
Returns
bool

Implemented in Wikibase\Lib\Units\BaseUnitStorage.


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