Wikibase
MediaWiki Wikibase extension
|
Basic unit storage functionality. More...
Public Member Functions | |
isPrimaryUnit ( $unit) | |
Check if certain unit is primary. More... | |
getConversion ( $unit) | |
Get conversion from this unit to primary unit. More... | |
Protected Member Functions | |
loadStorageData () | |
Load data from concrete storage. More... | |
Private Member Functions | |
loadData () | |
Load data from storage. More... | |
Private Attributes | |
$storageData | |
Basic unit storage functionality.
Concrete classes need to fill in data loading.
Wikibase\Lib\Units\BaseUnitStorage::getConversion | ( | $unit | ) |
Get conversion from this unit to primary unit.
string | $unit |
Implements Wikibase\Lib\Units\UnitStorage.
Wikibase\Lib\Units\BaseUnitStorage::isPrimaryUnit | ( | $unit | ) |
Check if certain unit is primary.
string | $unit |
Implements Wikibase\Lib\Units\UnitStorage.
|
private |
Load data from storage.
|
abstractprotected |
Load data from concrete storage.
The method should return array indexed by source unit. Each row should be either [<factor>, <unit>] or ['factor' => <factor>, 'unit' => <unit>]
Reimplemented in Wikibase\Lib\Units\JsonUnitStorage, Wikibase\Lib\Units\InMemoryUnitStorage, and Wikibase\Lib\Units\CSVUnitStorage.
|
private |