Wikibase
MediaWiki Wikibase extension
|
Array-based static unit storage. More...
Public Member Functions | |
__construct (array $data=null) | |
Public Member Functions inherited from Wikibase\Lib\Units\BaseUnitStorage | |
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 Attributes | |
$data | |
Array-based static unit storage.
Mostly useful for tests.
Wikibase\Lib\Units\InMemoryUnitStorage::__construct | ( | array | $data = null | ) |
array[] | null | $data | The data for the unit storage, a map from unit to an array of the form [ 'factor' => $factor, 'unit' => $unit ]. 'null' simulates a failure to load data. |
|
protected |
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 from Wikibase\Lib\Units\BaseUnitStorage.
|
private |