Wikibase
MediaWiki Wikibase extension
|
Factory for creating new snaks. More...
Public Member Functions | |
__construct (PropertyDataTypeLookup $dataTypeLookup, DataTypeFactory $dataTypeFactory, DataValueFactory $dataValueFactory) | |
newSnak (PropertyId $propertyId, string $snakType, $rawValue=null) | |
Builds and returns a new snak from the provided property, snak type and optional snak value. | |
Private Member Functions | |
createSnak (PropertyId $propertyId, string $snakType, DataValue $value=null) | |
Builds and returns a new snak from the provided property, snak type and optional snak value and value type. | |
Private Attributes | |
$dataTypeLookup | |
$dataTypeFactory | |
$dataValueFactory | |
Factory for creating new snaks.
Wikibase\Repo\SnakFactory::__construct | ( | PropertyDataTypeLookup | $dataTypeLookup, |
DataTypeFactory | $dataTypeFactory, | ||
DataValueFactory | $dataValueFactory ) |
|
private |
Builds and returns a new snak from the provided property, snak type and optional snak value and value type.
PropertyId | $propertyId | |
string | $snakType | |
DataValue | null | $value |
InvalidArgumentException |
Wikibase\Repo\SnakFactory::newSnak | ( | PropertyId | $propertyId, |
string | $snakType, | ||
$rawValue = null ) |
Builds and returns a new snak from the provided property, snak type and optional snak value.
PropertyId | $propertyId | |
string | $snakType | |
mixed | $rawValue |
PropertyDataTypeLookupException | from getDataTypeIdForProperty |
OutOfBoundsException | from getType |
InvalidArgumentException | from newDataValue, newDataValue and newSnak |
|
private |
|
private |
|
private |