Semantic MediaWiki and related extensions
|
Public Member Functions | |
addCallable ( $key, callable $callable) | |
clearCallable ( $key) | |
clear () | |
setFeatureSet ( $featureSet) | |
setDefaultOutputFormatters (array $defaultOutputFormatters) | |
newDataValueByType ( $typeId, $valueString=false, $caption=false, DIProperty $property=null, $contextPage=null) | |
newDataValueByItem (DataItem $dataItem, DIProperty $property=null, $caption=false, $contextPage=null) | |
newDataValueByProperty (DIProperty $property, $valueString=false, $caption=false, $contextPage=null) | |
newDataValueByText ( $propertyName, $valueString, $caption=false, DIWikiPage $contextPage=null) | |
newPropertyValueByLabel ( $propertyLabel, $caption=false, DIWikiPage $contextPage=null) | |
newPropertyValueByItem (DIProperty $property, $caption=false, DIWikiPage $contextPage=null) | |
newErrorValue ( $typeid, $errormsg='', $uservalue='', $caption=false) | |
newPropertyValue ( $propertyName, $valueString, $caption=false, DIWikiPage $contextPage=null) | |
Static Public Member Functions | |
static | getInstance () |
static | newDataItemValue (DataItem $dataItem, DIProperty $property=null, $caption=false) |
Deprecated methods. More... | |
static | newPropertyObjectValue (DIProperty $property, $valueString=false, $caption=false, $contextPage=null) |
static | newTypeIdValue ( $typeId, $valueString=false, $caption=false, DIProperty $property=null, $contextPage=null) |
Protected Member Functions | |
__construct (DataTypeRegistry $dataTypeRegistry, DataValueServiceFactory $dataValueServiceFactory) | |
Factory class for creating SMWDataValue objects for supplied types or properties and data values.
The class has the main entry point newTypeIdValue(), which creates a new datavalue object, possibly with preset user values, captions and property names. To create suitable datavalues for a given property, the method newDataValueByProperty() can be used.
GNU GPL v2+
|
protected |
DataTypeRegistry | $dataTypeRegistry | |
DataValueServiceFactory | $dataValueServiceFactory |
SMW\DataValueFactory::addCallable | ( | $key, | |
callable | $callable | ||
) |
string | $key | |
callable | $callable |
RuntimeException |
SMW\DataValueFactory::clear | ( | ) |
SMW\DataValueFactory::clearCallable | ( | $key | ) |
string | $key |
|
static |
|
static |
SMW\DataValueFactory::newDataValueByItem | ( | DataItem | $dataItem, |
DIProperty | $property = null , |
||
$caption = false , |
|||
$contextPage = null |
|||
) |
Create a value for a data item.
$dataItem | DataItem | |
$property | mixed null or SMWDIProperty property object for which this value is made | |
$caption | mixed user-defined caption, or false if none given | |
DIWikiPage | null | $contextPage |
SMW\DataValueFactory::newDataValueByProperty | ( | DIProperty | $property, |
$valueString = false , |
|||
$caption = false , |
|||
$contextPage = null |
|||
) |
Create a value for the given property, provided as an SMWDIProperty object. If no value is given, an empty container is created, the value of which can be set later on.
$property | SMWDIProperty property object for which this value is made |
$valueString | mixed user value string, or false if unknown |
$caption | mixed user-defined caption, or false if none given |
$contextPage | SMWDIWikiPage that provides a context for parsing the value string, or null |
SMW\DataValueFactory::newDataValueByText | ( | $propertyName, | |
$valueString, | |||
$caption = false , |
|||
DIWikiPage | $contextPage = null |
||
) |
This factory method returns a data value object from a given property, value string. It is intended to be used on user input to allow to turn a property and value string into a data value object.
string | $propertyName | property string |
string | $valueString | user value string |
mixed | $caption | user-defined caption |
SMWDIWikiPage | null | $contextPage | context for parsing the value string |
SMW\DataValueFactory::newDataValueByType | ( | $typeId, | |
$valueString = false , |
|||
$caption = false , |
|||
DIProperty | $property = null , |
||
$contextPage = null |
|||
) |
Create a value from a type id. If no $value is given, an empty container is created, the value of which can be set later on.
string | $typeId | id string for the given type |
string | false | $valueString | user value string, or false if unknown |
string | false | $caption | user-defined caption, or false if none given |
DIProperty | null | $property | property object for which this value is made, or null |
DIWikiPage | null | $contextPage | that provides a context for parsing the value string, or null |
SMW\DataValueFactory::newErrorValue | ( | $typeid, | |
$errormsg = '' , |
|||
$uservalue = '' , |
|||
$caption = false |
|||
) |
string | $typeid | |
string | array | $errormsg | |
string | $uservalue | |
string | $caption |
|
static |
SMW\DataValueFactory::newPropertyValue | ( | $propertyName, | |
$valueString, | |||
$caption = false , |
|||
DIWikiPage | $contextPage = null |
||
) |
SMW\DataValueFactory::newPropertyValueByItem | ( | DIProperty | $property, |
$caption = false , |
|||
DIWikiPage | $contextPage = null |
||
) |
DIProperty | $property | |
string | false | $caption | |
DIWikiPage | null | $contextPage |
SMW\DataValueFactory::newPropertyValueByLabel | ( | $propertyLabel, | |
$caption = false , |
|||
DIWikiPage | $contextPage = null |
||
) |
string | $propertyLabel | |
string | false | $caption | |
DIWikiPage | null | $contextPage |
|
static |
SMW\DataValueFactory::setDefaultOutputFormatters | ( | array | $defaultOutputFormatters | ) |
array | $defaultOutputFormatters |
SMW\DataValueFactory::setFeatureSet | ( | $featureSet | ) |
integer | $featureSet |