Factory for creating new snaks.
More...
|
| __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. More...
|
|
|
| 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. More...
|
|
Factory for creating new snaks.
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
◆ __construct()
◆ createSnak()
Wikibase\Repo\SnakFactory::createSnak |
( |
PropertyId |
$propertyId, |
|
|
string |
$snakType, |
|
|
DataValue |
$value = null |
|
) |
| |
|
private |
Builds and returns a new snak from the provided property, snak type and optional snak value and value type.
- Parameters
-
PropertyId | $propertyId | |
string | $snakType | |
DataValue | null | $value | |
- Returns
- Snak
- Exceptions
-
◆ newSnak()
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.
- Parameters
-
PropertyId | $propertyId | |
string | $snakType | |
mixed | $rawValue | |
- Returns
- Snak
- Exceptions
-
PropertyDataTypeLookupException | from getDataTypeIdForProperty |
OutOfBoundsException | from getType |
InvalidArgumentException | from newDataValue, newDataValue and newSnak |
◆ $dataTypeFactory
Wikibase\Repo\SnakFactory::$dataTypeFactory |
|
private |
◆ $dataTypeLookup
Wikibase\Repo\SnakFactory::$dataTypeLookup |
|
private |
◆ $dataValueFactory
Wikibase\Repo\SnakFactory::$dataValueFactory |
|
private |
The documentation for this class was generated from the following file: