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

Public Member Functions

 __construct ( $typeid=self::TYPE_ID)
 
 __clone ()
 
 getInceptiveProperty ()
 
 getPreferredLabel ()
 
 setLinkAttributes (array $linkAttributes)
 
 setCaption ( $caption)
 
 setOutputFormat ( $formatstring)
 
 setInverse ( $isinverse)
 
 getWikiPageValue ()
 
 isVisible ()
 
 isRestricted ()
 
 getShortWikiText ( $linker=null)
 
 getShortHTMLText ( $linker=null)
 
 getLongWikiText ( $linker=null)
 
 getLongHTMLText ( $linker=null)
 
 getWikiValue ()
 
 getFormattedLabel ( $format=DataValueFormatter::VALUE, $linker=null)
 
 getSearchLabel ()
 
 getPropertyTypeID ()
 
- Public Member Functions inherited from SMWDataValue
 __construct ( $typeid)
 
 getTypeID ()
 
 setUserValue ( $value, $caption=false)
 
 setDataItem (SMWDataItem $dataItem)
 
 setDataValueServiceFactory (DataValueServiceFactory $dataValueServiceFactory)
 
 setProperty (DIProperty $property)
 
 getProperty ()
 
 setContextPage (SMWDIWikiPage $contextPage=null)
 
 getContextPage ()
 
 setCaption ( $caption)
 
 getCaption ()
 
 getPreferredCaption ()
 
 setOutputFormat ( $formatString)
 
 getOutputFormat ()
 
 addError ( $error)
 
 addErrorMsg ( $error, $type=Message::TEXT)
 
 getErrorText ()
 
 getErrors ()
 
 getErrorsByType ( $type=null)
 
 getRestrictionError ()
 
 clearErrors ()
 
 getQueryDescription ( $value)
 
 getDataItem ()
 
 __toString ()
 
 getShortWikiText ( $linker=null)
 
 getShortHTMLText ( $linker=null)
 
 getLongWikiText ( $linker=null)
 
 getLongHTMLText ( $linker=null)
 
 getWikiValue ()
 
 getShortText ( $outputFormat, $linker=null)
 
 getLongText ( $outputFormat, $linker=null)
 
 getInfolinkText ( $outputFormat, $linker=null)
 
 getInfolinks ()
 
 getHash ()
 
 isNumeric ()
 
 isValid ()
 
 canUse ()
 
 isRestricted ()
 
 addCallable ( $key, callable $callable)
 
 hasCallable ( $key)
 
 getCallable ( $key)
 
 clearCallable ( $key)
 
 copyOptions (Options $options=null)
 
 setOption ( $key, $value)
 
 getOption ( $key, $default=false)
 
 hasFeature ( $feature)
 
 isEnabledFeature ( $feature)
 
 checkConstraints ()
 

Public Attributes

const TYPE_ID = '__pro'
 
const OPT_NO_HIGHLIGHT = 'no.highlight'
 
const OPT_HIGHLIGHT_LINKER = 'highlight.linker'
 
const OPT_NO_PREF_LHNT = 'no.preflabel.marker'
 
const OPT_CANONICAL_LABEL = 'canonical.label'
 
const FORMAT_LABEL = 'format.label'
 
const SEARCH_LABEL = 'search.label'
 
- Public Attributes inherited from SMWDataValue
const OPT_USER_LANGUAGE = 'user.language'
 
const OPT_CONTENT_LANGUAGE = 'content.language'
 
const OPT_QUERY_CONTEXT = 'query.context'
 
const OPT_QUERY_COMP_CONTEXT = 'query.comparator.context'
 
const OPT_DISABLE_INFOLINKS = 'disable.infolinks'
 
const OPT_DISABLE_SERVICELINKS = 'disable.servicelinks'
 
const OPT_COMPACT_INFOLINKS = 'compact.infolinks'
 

Protected Member Functions

 parseUserValue ( $value)
 
 loadDataItem (DataItem $dataItem)
 
- Protected Member Functions inherited from SMWDataValue
 getOptions ()
 
 parseUserValue ( $value)
 
 loadDataItem (SMWDataItem $dataItem)
 
 getServiceLinkParams ()
 
 checkAllowedValues ()
 

Protected Attributes

 $m_wikipage = null
 
 $linkAttributes = []
 
- Protected Attributes inherited from SMWDataValue
 $m_dataitem
 
 $m_property = null
 
 $m_contextPage = null
 
 $m_caption
 
 $m_typeid
 
 $m_outformat = false
 
 $restrictionError = false
 
 $dataValueServiceFactory
 

Additional Inherited Members

- Static Public Member Functions inherited from SMWDataValue
static prepareValue (&$value, &$comparator)
 

Detailed Description

Objects of this class represent properties in SMW.

This class represents both normal (user-defined) properties and predefined ("special") properties. Predefined properties may still have a standard label (and associated wiki article) and they will behave just like user-defined properties in most cases (e.g. when asking for a printout text, a link to the according page is produced).

It is possible that predefined properties have no visible label at all, if they are used only internally and never specified by or shown to the user. Those will use their internal ID as DB key, and empty texts for most printouts. All other properties use their canonical DB key (even if they are predefined and have an id).

Functions are provided to check whether a property is visible or user-defined, and to get the internal ID, if any.

Note
This datavalue is used only for representing properties and, possibly objects/values, but never for subjects (pages as such). Hence it does not provide a complete Title-like interface, or support for things like sortkey.

GNU GPL v2+

Since
3.0
Author
Markus Krötzsch
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\DataValues\PropertyValue::__construct (   $typeid = self::TYPE_ID)
Since
2.4
Parameters
string$typeid

Member Function Documentation

◆ __clone()

SMW\DataValues\PropertyValue::__clone ( )

We use the internal wikipage object to store some of this objects data. Clone it to make sure that data can be modified independently from the original object's content.

◆ getFormattedLabel()

SMW\DataValues\PropertyValue::getFormattedLabel (   $format = DataValueFormatter::VALUE,
  $linker = null 
)

Outputs a formatted property label that takes into account preferred/ canonical label characteristics

Parameters
integer | string$format
Linker | null$linker
Returns
string

◆ getInceptiveProperty()

SMW\DataValues\PropertyValue::getInceptiveProperty ( )
Note
If the inceptive property and the property referenced in dataItem are not equal then the dataItem represents the end target to which the inceptive property has been redirected.
Since
2.4
Returns
DIProperty

◆ getLongHTMLText()

SMW\DataValues\PropertyValue::getLongHTMLText (   $linker = null)
See also
DataValue::getLongHTMLText
Returns
string

◆ getLongWikiText()

SMW\DataValues\PropertyValue::getLongWikiText (   $linker = null)
See also
DataValue::getLongWikiText
Returns
string

◆ getPreferredLabel()

SMW\DataValues\PropertyValue::getPreferredLabel ( )
Since
2.5
Returns
string

◆ getPropertyTypeID()

SMW\DataValues\PropertyValue::getPropertyTypeID ( )

Convenience method to find the type id of this property. Most callers should rather use DIProperty::findPropertyTypeId() directly. Note that this is not the same as getTypeID(), which returns the id of this property datavalue.

Returns
string

◆ getSearchLabel()

SMW\DataValues\PropertyValue::getSearchLabel ( )

Outputs a label that corresponds to the display and sort characteristics ( e.g. display title etc.) and can be used to initiate a match and search process.

Since
2.5
Returns
string

◆ getShortHTMLText()

SMW\DataValues\PropertyValue::getShortHTMLText (   $linker = null)
See also
DataValue::getShortHTMLText
Returns
string

◆ getShortWikiText()

SMW\DataValues\PropertyValue::getShortWikiText (   $linker = null)
See also
DataValue::getShortWikiText
Returns
string

◆ getWikiPageValue()

SMW\DataValues\PropertyValue::getWikiPageValue ( )

Return a wiki page value that can be used for displaying this property, or null if no such wiki page exists (for predefined properties without any label).

Returns
SMWWikiPageValue or null

◆ getWikiValue()

SMW\DataValues\PropertyValue::getWikiValue ( )
See also
DataValue::getWikiValue
Returns
string

◆ isRestricted()

SMW\DataValues\PropertyValue::isRestricted ( )
Since
3.0
Returns
boolean

◆ isVisible()

SMW\DataValues\PropertyValue::isVisible ( )

Return TRUE if this is a property that can be displayed, and not a pre-defined property that is used only internally and does not even have a user-readable name.

Note
Every user defined property is necessarily visible.

◆ loadDataItem()

SMW\DataValues\PropertyValue::loadDataItem ( DataItem  $dataItem)
protected
See also
SMWDataValue::loadDataItem()
Parameters
$dataitemDataItem
Returns
boolean

◆ parseUserValue()

SMW\DataValues\PropertyValue::parseUserValue (   $value)
protected

Extended parsing function to first check whether value refers to pre-defined property, resolve aliases, and set internal property id accordingly.

Todo:
Accept/enforce property namespace.

◆ setLinkAttributes()

SMW\DataValues\PropertyValue::setLinkAttributes ( array  $linkAttributes)
Since
2.4
Parameters
array$linkAttributes

Member Data Documentation

◆ FORMAT_LABEL

const SMW\DataValues\PropertyValue::FORMAT_LABEL = 'format.label'

Special formatting of the label/preferred label

◆ OPT_CANONICAL_LABEL

const SMW\DataValues\PropertyValue::OPT_CANONICAL_LABEL = 'canonical.label'

Indicates to use a canonical label

◆ OPT_HIGHLIGHT_LINKER

const SMW\DataValues\PropertyValue::OPT_HIGHLIGHT_LINKER = 'highlight.linker'

Use linker with the highlighter

◆ OPT_NO_HIGHLIGHT

const SMW\DataValues\PropertyValue::OPT_NO_HIGHLIGHT = 'no.highlight'

Avoid the display of a tooltip

◆ OPT_NO_PREF_LHNT

const SMW\DataValues\PropertyValue::OPT_NO_PREF_LHNT = 'no.preflabel.marker'

Avoid the display of a preferred label marker

◆ SEARCH_LABEL

const SMW\DataValues\PropertyValue::SEARCH_LABEL = 'search.label'

Label to be used for matching a DB search

◆ TYPE_ID

const SMW\DataValues\PropertyValue::TYPE_ID = '__pro'

DV identifier


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

About | General disclaimer | Privacy policy