Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
SMW\DataValues\MonolingualTextValue Class Reference
Inheritance diagram for SMW\DataValues\MonolingualTextValue:
Inheritance graph
[legend]
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 ()
 
 getTextValueByLanguageCode ( $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

◆ __construct()

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

Member Function Documentation

◆ getDataItems()

SMW\DataValues\MonolingualTextValue::getDataItems ( )
Since
2.4

◆ getLongHTMLText()

SMW\DataValues\MonolingualTextValue::getLongHTMLText (   $linker = null)
See also
DataValue::getLongHTMLText

◆ getLongWikiText()

SMW\DataValues\MonolingualTextValue::getLongWikiText (   $linker = null)
See also
DataValue::getLongWikiText

◆ getProperties()

SMW\DataValues\MonolingualTextValue::getProperties ( )
See also
AbstractMultiValue::getProperties
Parameters
DIProperty[]$properties

◆ getPropertyDataItems()

SMW\DataValues\MonolingualTextValue::getPropertyDataItems ( )
Since
2.4
Note
called by AbstractRecordValue::getPropertyDataItems
Returns
DIProperty[]

◆ getShortHTMLText()

SMW\DataValues\MonolingualTextValue::getShortHTMLText (   $linker = null)
See also
DataValue::getShortHTMLText

◆ getShortWikiText()

SMW\DataValues\MonolingualTextValue::getShortWikiText (   $linker = null)
See also
DataValue::getShortWikiText

◆ getTextValueByLanguageCode()

SMW\DataValues\MonolingualTextValue::getTextValueByLanguageCode (   $languageCode)
Since
2.4
Parameters
string$languageCode
Returns
DataValue|null

◆ getTextWithLanguageTag()

SMW\DataValues\MonolingualTextValue::getTextWithLanguageTag (   $text,
  $languageCode 
)
Since
2.5
Parameters
$userValue
string$languageCode
Returns
string

◆ getValuesFromString()

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

◆ getWikiValue()

SMW\DataValues\MonolingualTextValue::getWikiValue ( )
See also
DataValue::getWikiValue

◆ loadDataItem()

SMW\DataValues\MonolingualTextValue::loadDataItem ( DataItem  $dataItem)
protected
See also
DataValue::loadDataItem
Parameters
DataItem$dataItem
Returns
boolean

◆ parseUserValue()

SMW\DataValues\MonolingualTextValue::parseUserValue (   $userValue)
protected
See also
DataValue::parseUserValue
Note
called by DataValue::setUserValue
Parameters
string$userValue

◆ setFieldProperties()

SMW\DataValues\MonolingualTextValue::setFieldProperties ( array  $properties)
See also
AbstractMultiValue::setFieldProperties
Parameters
DIProperty[]$properties

◆ toArray()

SMW\DataValues\MonolingualTextValue::toArray ( )
Since
2.5
Returns
array

◆ toString()

SMW\DataValues\MonolingualTextValue::toString ( )
Since
2.5
Returns
string

Member Data Documentation

◆ TYPE_ID

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

DV identifier


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

About | General disclaimer | Privacy policy