BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
DataValues\DataValue Interface Reference
Inheritance diagram for DataValues\DataValue:
Collaboration diagram for DataValues\DataValue:

Public Member Functions

 getSortKey ()
 
 getValue ()
 
 getArrayValue ()
 
 toArray ()
 
- Public Member Functions inherited from Hashable
 getHash ()
 
- Public Member Functions inherited from Comparable
 equals ($target)
 
- Public Member Functions inherited from Serializable
 serialize ()
 
 unserialize ($serialized)
 
- Public Member Functions inherited from Copyable
 getCopy ()
 

Static Public Member Functions

static getType ()
 

Detailed Description

Interface for objects that represent a single data value.

Since
0.1

GNU GPL v2+

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >

Member Function Documentation

DataValues\DataValue::getArrayValue ( )

Returns the value in array form.

For simple values (ie a string) the return value will be equal to that of

See Also
getValue.

Complex DataValues can provide a nicer implementation though, for instance a geographical coordinate value could provide an array with keys latitude, longitude and altitude, each pointing to a simple float value.

Since
0.1
Returns
mixed

Implemented in DataValues\Geo\Values\GlobeCoordinateValue, DataValues\Geo\Values\LatLongValue, DataValues\MonolingualTextValue, DataValues\UnDeserializableValue, and DataValues\DataValueObject.

DataValues\DataValue::getSortKey ( )
static DataValues\DataValue::getType ( )
static
DataValues\DataValue::getValue ( )

Returns the value contained by the DataValue. If this value is not simple and does not have it's own type that represents it, the DataValue itself will be returned. In essence, this method returns the "simplest" representation of the value.

Example:

  • NumberDataValue returns a float or integer
  • MediaWikiTitleValue returns a Title object
  • QuantityValue returns itself
Since
0.1
Returns
mixed

Implemented in DataValues\UnDeserializableValue, DataValues\Geo\Values\GlobeCoordinateValue, DataValues\Geo\Values\LatLongValue, DataValues\MultilingualTextValue, DataValues\MonolingualTextValue, ParamProcessor\MediaWikiTitleValue, DataValues\StringValue, DataValues\UnknownValue, DataValues\BooleanValue, and DataValues\NumberValue.

DataValues\DataValue::toArray ( )

Returns the whole DataValue in array form.

The array contains:

  • value: mixed, same as the result of
    See Also
    getArrayValue
  • type: string, same as the result of
    See Also
    getType
    This is sufficient for unserialization in a factory.
Since
0.1
Returns
array

Implemented in DataValues\UnDeserializableValue, and DataValues\DataValueObject.


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