Wikibase
MediaWiki Wikibase extension
Wikibase\DataModel\Snak\DerivedPropertyValueSnak Class Reference

PropertyValueSnak with with derived values attached. More...

+ Inheritance diagram for Wikibase\DataModel\Snak\DerivedPropertyValueSnak:
+ Collaboration diagram for Wikibase\DataModel\Snak\DerivedPropertyValueSnak:

Public Member Functions

 __construct ( $propertyId, DataValue $dataValue, array $derivedDataValues)
 
 getDerivedDataValues ()
 
 getDerivedDataValue ( $key)
 
 newPropertyValueSnak ()
 
- Public Member Functions inherited from Wikibase\DataModel\Snak\PropertyValueSnak
 __construct ( $propertyId, DataValue $dataValue)
 Support for passing in an EntityId instance that is not a PropertyId instance has been deprecated since 0.5. More...
 
 getDataValue ()
 Returns the value of the property value snak. More...
 
 serialize ()
 
 unserialize ( $serialized)
 
 getType ()
 
- Public Member Functions inherited from Wikibase\DataModel\Snak\SnakObject
 __construct ( $propertyId)
 Support for passing in an EntityId instance that is not a PropertyId instance has been deprecated since 0.5. More...
 
 getPropertyId ()
 
 getHash ()
 
 equals ( $target)
 

Private Attributes

 $derivedDataValues = []
 

Additional Inherited Members

- Protected Attributes inherited from Wikibase\DataModel\Snak\PropertyValueSnak
 $dataValue
 
- Protected Attributes inherited from Wikibase\DataModel\Snak\SnakObject
 $propertyId
 

Detailed Description

PropertyValueSnak with with derived values attached.

Derived DataValues can be used to provide information such as normalized values.

Calls to the getType method will indicate that this is a PropertyValueSnak.

Direct serialization of this object will not include the extra derived values.

The hash of this object is not changed by additional Derived values. The hash of this object will differ from the PropertyValueSnak of this object.

This object will ->equal other DerivedPropertyValueSnaks with the same base PropertyValueSnak. This object will NOT ->equal any PropertyValueSnaks. A newPropertyValueSnak method is provided for comparison convenience.

Since
3.1
Author
Addshore

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Snak\DerivedPropertyValueSnak::__construct (   $propertyId,
DataValue  $dataValue,
array  $derivedDataValues 
)
Parameters
PropertyId | EntityId | int$propertyId
DataValue$dataValue
DataValue[]$derivedDataValues
Exceptions
InvalidArgumentException

Member Function Documentation

◆ getDerivedDataValue()

Wikibase\DataModel\Snak\DerivedPropertyValueSnak::getDerivedDataValue (   $key)
Parameters
string$key
Returns
DataValue|null

◆ getDerivedDataValues()

Wikibase\DataModel\Snak\DerivedPropertyValueSnak::getDerivedDataValues ( )
Returns
DataValue[] with string keys

◆ newPropertyValueSnak()

Wikibase\DataModel\Snak\DerivedPropertyValueSnak::newPropertyValueSnak ( )

Member Data Documentation

◆ $derivedDataValues

Wikibase\DataModel\Snak\DerivedPropertyValueSnak::$derivedDataValues = []
private

The documentation for this class was generated from the following file: