Wikibase
MediaWiki Wikibase extension
|
Basic unit storage functionality. More...
Public Member Functions | |
isPrimaryUnit ( $unit) | |
Check if certain unit is primary. | |
getConversion ( $unit) | |
Get conversion from this unit to primary unit. | |
Protected Member Functions | |
loadStorageData () | |
Load data from concrete storage. | |
Private Member Functions | |
loadData () | |
Load data from storage. | |
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\CSVUnitStorage, Wikibase\Lib\Units\InMemoryUnitStorage, and Wikibase\Lib\Units\JsonUnitStorage.
|
private |