Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
SMW\DataValues\MonolingualTextValue Class Reference
Collaboration diagram for SMW\DataValues\MonolingualTextValue:
Collaboration graph
[legend]

Public Member Functions

 __construct ($typeid= '')
 
 setFieldProperties (array $properties)
 
 getProperties ()
 
 getTextWithLanguageTag ($text, $languageCode)
 
 getValuesFromString ($userValue)
 
 getShortWikiText ($linker=null)
 
 getShortHTMLText ($linker=null)
 
 getLongWikiText ($linker=null)
 
 getLongHTMLText ($linker=null)
 
 getWikiValue ()
 
 getPropertyDataItems ()
 
 getDataItems ()
 
 getTextValueByLanguage ($languageCode)
 
 toArray ()
 
 toString ()
 

Public Attributes

const TYPE_ID = '_mlt_rec'
 

Protected Member Functions

 parseUserValue ($userValue)
 
 loadDataItem (DataItem $dataItem)
 

Detailed Description

MonolingualTextValue requires two components, a language code and a text.

A text foo@en is expected to be invoked with a BCP47 language code tag and a language dependent text component.

Internally, the value is stored as container object that represents the language code and text as separate entities in order to be queried individually.

External output representation depends on the context (wiki, html) whether the language code is omitted or not.

GNU GPL v2+

Since
2.4
Author
mwjames

Constructor & Destructor Documentation

SMW\DataValues\MonolingualTextValue::__construct (   $typeid = '')
Parameters
string$typeid

Member Function Documentation

SMW\DataValues\MonolingualTextValue::getDataItems ( )
Since
2.4
SMW\DataValues\MonolingualTextValue::getLongHTMLText (   $linker = null)
See also
DataValue::getLongHTMLText
SMW\DataValues\MonolingualTextValue::getLongWikiText (   $linker = null)
See also
DataValue::getLongWikiText
SMW\DataValues\MonolingualTextValue::getProperties ( )
See also
AbstractMultiValue::getProperties
Parameters
DIProperty[]$properties
SMW\DataValues\MonolingualTextValue::getPropertyDataItems ( )
Since
2.4
Note
called by AbstractRecordValue::getPropertyDataItems
Returns
DIProperty[]
SMW\DataValues\MonolingualTextValue::getShortHTMLText (   $linker = null)
See also
DataValue::getShortHTMLText
SMW\DataValues\MonolingualTextValue::getShortWikiText (   $linker = null)
See also
DataValue::getShortWikiText
SMW\DataValues\MonolingualTextValue::getTextValueByLanguage (   $languageCode)
Since
2.4
Parameters
string$languageCode
Returns
DataValue|null
SMW\DataValues\MonolingualTextValue::getTextWithLanguageTag (   $text,
  $languageCode 
)
Since
2.5
Parameters
$userValue
string$languageCode
Returns
string
SMW\DataValues\MonolingualTextValue::getValuesFromString (   $userValue)
Note
called by MonolingualTextValueDescriptionDeserializer::deserialize and MonolingualTextValue::parseUserValue

No explicit check is made on the validity of a language code and is expected to be done before calling this method.

Since
2.4
Parameters
string$userValue
Returns
array
SMW\DataValues\MonolingualTextValue::getWikiValue ( )
See also
DataValue::getWikiValue
SMW\DataValues\MonolingualTextValue::loadDataItem ( DataItem  $dataItem)
protected
See also
DataValue::loadDataItem
Parameters
DataItem$dataItem
Returns
boolean
SMW\DataValues\MonolingualTextValue::parseUserValue (   $userValue)
protected
See also
DataValue::parseUserValue
Note
called by DataValue::setUserValue
Parameters
string$userValue
SMW\DataValues\MonolingualTextValue::setFieldProperties ( array  $properties)
See also
AbstractMultiValue::setFieldProperties
Parameters
DIProperty[]$properties
SMW\DataValues\MonolingualTextValue::toArray ( )
Since
2.5
Returns
array
SMW\DataValues\MonolingualTextValue::toString ( )
Since
2.5
Returns
string

Member Data Documentation

const SMW\DataValues\MonolingualTextValue::TYPE_ID = '_mlt_rec'

DV identifier


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