Inherits SMWWikiPageValue.
Public Member Functions | |
| getDBkeys () | |
| Return an array of values that characterize the given datavalue completely, and that are sufficient to reproduce a value of identical content using the function setDBkeys(). | |
| getSignature () | |
| Return a signature string that encodes the order and type of the data that is contained in the array given by getDBkeys(). | |
| getValueIndex () | |
| This function specifies the indexes of the DB keys that should be used for sorting values of this type. | |
| getLabelIndex () | |
| This function specifies the index of the DB key that should be used for string-matching values of this type. | |
Protected Member Functions | |
| parseDBkeys ($args) | |
| Initialise the datavalue from the given value array. | |
However, it is tailored for uses where it is enough to store the title string of the page without namespace, interwiki prefix, or sortkey. This is useful for "special" properties like "Has type" where the namespace is fixed, and which do not need any of the other settings. The advantage of the reduction of data is that these important values can be stored in smaller tables that allow for faster direct access than general page type values.
Definition at line 22 of file SMW_DV_SimpleWikiPage.php.
| SMWSimpleWikiPageValue::parseDBkeys | ( | $ | args | ) | [protected] |
Initialise the datavalue from the given value array.
The format of this array corresponds to the output of getDBkeys() but the method might be called with shorter arrays (e.g. if typing information changed since a value was stored). However, there will always be at least one element in the array.
| array | $args |
Reimplemented from SMWWikiPageValue.
Definition at line 24 of file SMW_DV_SimpleWikiPage.php.
| SMWSimpleWikiPageValue::getDBkeys | ( | ) |
Return an array of values that characterize the given datavalue completely, and that are sufficient to reproduce a value of identical content using the function setDBkeys().
The value array must use number keys that agree with the array's natural order (in which the data was added), and the array MUST contain at least one value in any case. Moreover, the order and type of the array's entries must be as described in by getSignature(); see its documentation for details. The only exception are classes that inherit from SMWContainerValue which must adhere to the special format of this class.
The array should only contain components required for storing and sorting. It should provide a compact form for the data that is still easy to unserialize into a new object. Many datatypes will use arrays with only one entry here.
Reimplemented from SMWWikiPageValue.
Definition at line 36 of file SMW_DV_SimpleWikiPage.php.
References SMWDataValue::unstub().
| SMWSimpleWikiPageValue::getSignature | ( | ) |
Return a signature string that encodes the order and type of the data that is contained in the array given by getDBkeys().
Single letters are used to encode different datatypes. The signature is used to determine how to store data of this kind. The available type letters are:
Do not use any other letters in signatures of datavalues. For example, a wiki page consists of a title, namespace, interwiki prefix, and a sortkey for ordering it, so its signature is "tnwt". The below default definition provides a workable fallback, but it is recommended to define the signature explicitly in all datavalues that implement getDBkeys() anew.
Reimplemented from SMWWikiPageValue.
Definition at line 41 of file SMW_DV_SimpleWikiPage.php.
| SMWSimpleWikiPageValue::getValueIndex | ( | ) |
This function specifies the indexes of the DB keys that should be used for sorting values of this type.
It refers to the array that is returned by getDBkeys() and specified by getSignature(), where the first index is 0. For example, a wiki page type with signature "tnwt" would set this value to 3 so that page are ordered by their sortkey (the second "t" field). The order that is used (e.g. numeric or lexicographic) is determined by the type of the resepctive field. If no ordering is supported for this data value, then -1 can be returned here.
Reimplemented from SMWWikiPageValue.
Definition at line 45 of file SMW_DV_SimpleWikiPage.php.
| SMWSimpleWikiPageValue::getLabelIndex | ( | ) |
This function specifies the index of the DB key that should be used for string-matching values of this type.
SMW supports some query conditions that involve string patterns. Since numerical sort fields cannot be used for this, this index might differ from getValueIndex(). Otherwise, all documentation of getValueIndex() applies.
Reimplemented from SMWWikiPageValue.
Definition at line 49 of file SMW_DV_SimpleWikiPage.php.
1.5.6