Inherits SMWDataValue.
Public Member Functions | |
| __clone () | |
| We use the internal wikipage object to store some of this objects data. | |
| setCaption ($caption) | |
| Change the caption (the text used for displaying this datavalue). | |
| setOutputFormat ($formatstring) | |
| Define a particular output format. | |
| setInverse ($isinverse) | |
| 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). | |
| 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. | |
| getShortWikiText ($linked=null) | |
| Returns a short textual representation for this data value. | |
| getShortHTMLText ($linked=null) | |
| Returns a short textual representation for this data value. | |
| getLongWikiText ($linked=null) | |
| Return the long textual description of the value, as printed for example in the factbox. | |
| getLongHTMLText ($linked=null) | |
| Return the long textual description of the value, as printed for example in the factbox. | |
| getWikiValue () | |
| Return the plain wiki version of the value, or FALSE if no such version is available. | |
| getPropertyID () | |
| If this property was not user defined, return the internal ID string referring to that property. | |
| getTypesValue () | |
| Return an SMWTypesValue object representing the datatype of this property. | |
| getPropertyTypeID () | |
| Convenience method to find the type id of this property. | |
| isUserDefined () | |
| isShown () | |
| isInverse () | |
| getDBkey () | |
| Return a DB-key-like string: for visible properties, it is the actual DB key, for internal (invisible) properties, it is the property ID. | |
| getText () | |
Static Public Member Functions | |
| static | makeUserProperty ($propertyName) |
| Static function for creating a new property object from a propertyname (string) as a user might enter it. | |
| static | makeProperty ($propertyid) |
| Static function for creating a new property object from a property identifier (string) as it might be used internally. | |
| static | registerProperty ($id, $typeid, $label=false, $show=false) |
| A function for registering/overwriting predefined properties for SMW. | |
| static | registerPropertyAlias ($id, $label) |
| Add a new alias label to an existing datatype id. | |
Protected Member Functions | |
| parseUserValue ($value) | |
| Extended parsing function to first check whether value refers to pre-defined property, resolve aliases, and set internal property id accordingly. | |
| loadDataItem (SMWDataItem $dataItem) | |
| highlightText ($text) | |
| Create special highlighting for hinting at special properties. | |
Protected Attributes | |
| $m_wikipage = null | |
Private Attributes | |
| $mPropTypeValue | |
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 proeprties 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.
Definition at line 35 of file SMW_DV_Property.php.
| static SMWPropertyValue::makeUserProperty | ( | $ | propertyName | ) | [static] |
Static function for creating a new property object from a propertyname (string) as a user might enter it.
| string | $propertyName |
Definition at line 61 of file SMW_DV_Property.php.
Referenced by SMWParseData::addProperty(), SMWSemanticData::addPropertyValue(), SMWSubobject::addPropertyValueToSemanticData(), SMWSQLStore2QueryEngine::applyOrderConditions(), SMWSearchByProperty::execute(), SMWPageProperty::execute(), SFFormPrinter::formHTML(), SFAutocompleteAPI::getAllValuesForProperty(), SMWQueryParser::getPropertyDescription(), SMWSpecialBrowse::getPropertyLabel(), SMWQueryProcessor::getSortKeys(), SDFilter::load(), ApiAskArgs::printoutFromString(), SMWQueryProcessor::processFunctionParams(), SMWDeclare::render(), and SFTemplateField::setTypeAndPossibleValues().
| static SMWPropertyValue::makeProperty | ( | $ | propertyid | ) | [static] |
Static function for creating a new property object from a property identifier (string) as it might be used internally.
This might be the DB key version of some property title text or the id of a predefined property (such as '_TYPE').
The resulting property object might be invalid if the provided name is not allowed. An object is returned in any case.
Definition at line 79 of file SMW_DV_Property.php.
Referenced by SFUtils::getSMWPropertyValues(), and SDUtils::getSMWPropertyValues().
| SMWPropertyValue::__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.
Definition at line 91 of file SMW_DV_Property.php.
| SMWPropertyValue::parseUserValue | ( | $ | value | ) | [protected] |
Extended parsing function to first check whether value refers to pre-defined property, resolve aliases, and set internal property id accordingly.
NOTE The cast is necessary at least in PHP 5.3.3 to get string '' instead of boolean false.
Reimplemented from SMWDataValue.
Definition at line 100 of file SMW_DV_Property.php.
References SMWDataValue::addError(), SMWDIProperty::newFromUserLabel(), and smwfNormalTitleText().
| SMWPropertyValue::loadDataItem | ( | SMWDataItem $ | dataItem | ) | [protected] |
| $dataitem | SMWDataItem |
Reimplemented from SMWDataValue.
Definition at line 128 of file SMW_DV_Property.php.
References SMWDataItem::TYPE_PROPERTY.
| SMWPropertyValue::setCaption | ( | $ | caption | ) |
Change the caption (the text used for displaying this datavalue).
The given value must be a string.
| string | $caption |
Reimplemented from SMWDataValue.
Definition at line 140 of file SMW_DV_Property.php.
References getWikiPageValue().
| SMWPropertyValue::setOutputFormat | ( | $ | formatString | ) |
Define a particular output format.
Output formats are user-supplied strings that the datavalue may (or may not) use to customise its return value. For example, quantities with units of measurement may interpret the string as a desired output unit. In other cases, the output format might be built-in and subject to internationalisation (which the datavalue has to implement). In any case, an empty string resets the output format to the default.
There is one predeeind output format that all datavalues should respect: the format '-' indicates "plain" output that is most useful for further processing the value in a template. It should not use any wiki markup or beautification, and it should also avoid localization to the current language. When users explicitly specify an empty format string in a query, it is normalized to "-" to avoid confusion. Note that empty format strings are not interpreted in this way when directly passed to this function.
| string | $formatString |
Reimplemented from SMWDataValue.
Definition at line 147 of file SMW_DV_Property.php.
| SMWPropertyValue::setInverse | ( | $ | isinverse | ) |
Definition at line 154 of file SMW_DV_Property.php.
| SMWPropertyValue::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).
Definition at line 164 of file SMW_DV_Property.php.
References SMWDataValue::addError(), and SMWDataValueFactory::newDataItemValue().
Referenced by getLongHTMLText(), getLongWikiText(), getShortHTMLText(), getShortWikiText(), and setCaption().
| SMWPropertyValue::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.
Definition at line 183 of file SMW_DV_Property.php.
References SMWDataValue::isValid().
Referenced by getLongHTMLText(), getLongWikiText(), getShortHTMLText(), getShortWikiText(), and getWikiValue().
| SMWPropertyValue::getShortWikiText | ( | $ | linked = null |
) |
Returns a short textual representation for this data value.
If the value was initialised from a user supplied string, then this original string should be reflected in this short version (i.e. no normalisation should normally happen). There might, however, be additional parts such as code for generating tooltips. The output is in wiki text.
The parameter $linked controls linking of values such as titles and should be non-NULL and non-false if this is desired.
Reimplemented from SMWDataValue.
Definition at line 187 of file SMW_DV_Property.php.
References getWikiPageValue(), highlightText(), and isVisible().
| SMWPropertyValue::getShortHTMLText | ( | $ | linker = null |
) |
Returns a short textual representation for this data value.
If the value was initialised from a user supplied string, then this original string should be reflected in this short version (i.e. no normalisation should normally happen). There might, however, be additional parts such as code for generating tooltips. The output is in HTML text.
The parameter $linker controls linking of values such as titles and should be some Linker object (or NULL for no linking).
Reimplemented from SMWDataValue.
Definition at line 196 of file SMW_DV_Property.php.
References getWikiPageValue(), highlightText(), and isVisible().
| SMWPropertyValue::getLongWikiText | ( | $ | linked = null |
) |
Return the long textual description of the value, as printed for example in the factbox.
If errors occurred, return the error message The result always is a wiki-source string.
The parameter $linked controls linking of values such as titles and should be non-NULL and non-false if this is desired.
Reimplemented from SMWDataValue.
Definition at line 205 of file SMW_DV_Property.php.
References getWikiPageValue(), highlightText(), and isVisible().
| SMWPropertyValue::getLongHTMLText | ( | $ | linker = null |
) |
Return the long textual description of the value, as printed for example in the factbox.
If errors occurred, return the error message The result always is an HTML string.
The parameter $linker controls linking of values such as titles and should be some Linker object (or NULL for no linking).
Reimplemented from SMWDataValue.
Definition at line 214 of file SMW_DV_Property.php.
References getWikiPageValue(), highlightText(), and isVisible().
| SMWPropertyValue::getWikiValue | ( | ) |
Return the plain wiki version of the value, or FALSE if no such version is available.
The returned string suffices to reobtain the same DataValue when passing it as an input string to setUserValue().
Reimplemented from SMWDataValue.
Definition at line 223 of file SMW_DV_Property.php.
References isInverse(), and isVisible().
Referenced by SMWSpecialBrowse::getPropertyLabel().
| SMWPropertyValue::getPropertyID | ( | ) |
If this property was not user defined, return the internal ID string referring to that property.
Otherwise return FALSE;
Definition at line 231 of file SMW_DV_Property.php.
| SMWPropertyValue::getTypesValue | ( | ) |
Return an SMWTypesValue object representing the datatype of this property.
Definition at line 240 of file SMW_DV_Property.php.
References SMWDataValue::getErrors(), getPropertyTypeID(), SMWDataValue::isValid(), and SMWTypesValue::newFromTypeId().
| SMWPropertyValue::getPropertyTypeID | ( | ) |
Convenience method to find the type id of this property.
Most callers should rather use SMWDIProperty::findPropertyTypeId() directly. Note that this is not the same as getTypeID(), which returns the id of this property datavalue.
Definition at line 256 of file SMW_DV_Property.php.
References SMWDataValue::isValid().
Referenced by getTypesValue().
| SMWPropertyValue::highlightText | ( | $ | text | ) | [protected] |
Create special highlighting for hinting at special properties.
Definition at line 267 of file SMW_DV_Property.php.
References SMWOutputs::requireResource().
Referenced by getLongHTMLText(), getLongWikiText(), getShortHTMLText(), and getShortWikiText().
| static SMWPropertyValue::registerProperty | ( | $ | id, | |
| $ | typeid, | |||
| $ | label = false, |
|||
| $ | show = false | |||
| ) | [static] |
A function for registering/overwriting predefined properties for SMW.
Should be called from within the hook 'smwInitProperties'. Ids should start with three underscores "___" to avoid current and future confusion with SMW built-ins.
Definition at line 284 of file SMW_DV_Property.php.
References SMWDIProperty::registerProperty().
Referenced by SFUtils::registerProperty(), and sdfInitProperties().
| static SMWPropertyValue::registerPropertyAlias | ( | $ | id, | |
| $ | label | |||
| ) | [static] |
Add a new alias label to an existing datatype id.
Note that every ID should have a primary label, either provided by SMW or registered with registerDatatype. This function should be called from within the hook 'smwInitDatatypes'.
Definition at line 295 of file SMW_DV_Property.php.
References SMWDIProperty::registerPropertyAlias().
Referenced by sdfInitProperties().
| SMWPropertyValue::isUserDefined | ( | ) |
Definition at line 304 of file SMW_DV_Property.php.
| SMWPropertyValue::isShown | ( | ) |
Definition at line 313 of file SMW_DV_Property.php.
| SMWPropertyValue::isInverse | ( | ) |
Definition at line 322 of file SMW_DV_Property.php.
Referenced by getWikiValue().
| SMWPropertyValue::getDBkey | ( | ) |
Return a DB-key-like string: for visible properties, it is the actual DB key, for internal (invisible) properties, it is the property ID.
The value agrees with the first component of getDBkeys() and it can be used in its place.
Definition at line 334 of file SMW_DV_Property.php.
| SMWPropertyValue::getText | ( | ) |
Definition at line 343 of file SMW_DV_Property.php.
SMWPropertyValue::$m_wikipage = null [protected] |
Definition at line 42 of file SMW_DV_Property.php.
SMWPropertyValue::$mPropTypeValue [private] |
Definition at line 48 of file SMW_DV_Property.php.
1.5.6