|
| __construct (SMWSQLStore3 $store, SQLStoreFactory $factory) |
|
| isRedirect (DIWikiPage $subject) |
|
| isUnique (DataItem $dataItem) |
|
| findRedirect ( $title, $namespace) |
|
| addRedirect ( $id, $title, $namespace) |
|
| updateRedirect ( $id, $title, $namespace) |
|
| deleteRedirect ( $title, $namespace) |
|
| getSMWPageIDandSort ( $title, $namespace, $iw, $subobjectName, &$sortkey, $canonical, $fetchHashes=false) |
|
| findDuplicates () |
|
| findAllEntitiesThatMatch ( $title, $namespace, $iw=null, $subobjectName='') |
|
| exists (DIWikiPage $subject) |
|
| getId (DIWikiPage $subject) |
|
| getSMWPageID ( $title, $namespace, $iw, $subobjectName, $canonical=true, $fetchHashes=false) |
|
| makeSMWPageID ( $title, $namespace, $iw, $subobjectName, $canonical=true, $sortkey='', $fetchHashes=false) |
|
| getPropertyInterwiki (SMWDIProperty $property) |
|
| updateInterwikiField ( $sid, DIWikiPage $subject, $interwiki=null) |
|
| findAssociatedRev ( $title, $namespace='', $iw='') |
|
| updateRevField ( $sid, $rev_id) |
|
| getSMWPropertyID (SMWDIProperty $property) |
|
| makeSMWPropertyID (SMWDIProperty $property) |
|
| moveSMWPageID ( $curid, $targetid=0) |
|
| computeSha1 ( $args='') |
|
| warmUpCache ( $list=[]) |
|
| setCache ( $title, $namespace, $interwiki, $subobject, $id, $sortkey) |
|
| getDataItemById ( $id) |
|
| getDataItemsFromList (array $idlist, RequestOptions $requestOptions=null) |
|
| getDataItemPoolHashListFor (array $idlist, RequestOptions $requestOptions=null) |
|
| deleteCache ( $title, $namespace, $interwiki, $subobject) |
|
| initCache () |
|
| getPropertyTableHashes ( $sid) |
|
| setPropertyTableHashes ( $sid, $hash=null) |
|
| getIdTable () |
|
- Since
- 1.8
- Author
- Markus Krötzsch Class to access the SMW IDs table in SQLStore3. Provides transparent in-memory caching facilities.
Documentation for the SMW IDs table: This table is a dictionary that assigns integer IDs to pages, properties, and other objects used by SMW. All tables that refer to such objects store these IDs instead. If the ID information is lost (e.g., table gets deleted), then the data stored in SMW is no longer meaningful: all tables need to be dropped, recreated, and refreshed to get back to a working database.
The table has a column for storing interwiki prefixes, used to refer to pages on external sites (like in MediaWiki). This column is also used to mark some special objects in the table, using "interwiki prefixes" that cannot occur in MediaWiki:
- Rows with iw SMW_SQL3_SMWREDIIW are similar to normal entries for (internal) wiki pages, but the iw indicates that the page is a redirect, the (target of which should be sought using the smw_fpt_redi table.
- The (unique) row with iw SMW_SQL3_SMWBORDERIW just marks the border between predefined ids (rows that are reserved for hardcoded ids built into SMW) and normal entries. It is no object, but makes sure that SQL's auto increment counter is high enough to not add any objects before that marked "border".
- Note
- Do not call the constructor of SMWDIWikiPage using data from the SMW IDs table; use SMWDIHandlerWikiPage::dataItemFromDBKeys() instead. The table does not always contain data as required wiki pages. Especially predefined properties are represented by language-independent keys rather than proper titles. SMWDIHandlerWikiPage takes care of this.
- Since
- 1.8
SMWSql3SmwIds::getSMWPageIDandSort |
( |
|
$title, |
|
|
|
$namespace, |
|
|
|
$iw, |
|
|
|
$subobjectName, |
|
|
& |
$sortkey, |
|
|
|
$canonical, |
|
|
|
$fetchHashes = false |
|
) |
| |
Find the numeric ID used for the page of the given title, namespace, interwiki, and subobject. If $canonical is set to true, redirects are taken into account to find the canonical alias ID for the given page. If no such ID exists, 0 is returned. The Call-By-Ref parameter $sortkey is set to the current sortkey, or to '' if no ID exists.
If $fetchhashes is true, the property table hash blob will be retrieved in passing if the opportunity arises, and cached internally. This will speed up a subsequent call to getPropertyTableHashes() for this id. This should only be done if such a call is intended, both to safe the previous cache and to avoid extra work (even if only a little) to fill it.
- Since
- 1.8
- Parameters
-
string | $title | DB key |
integer | $namespace | namespace |
string | $iw | interwiki prefix |
string | $subobjectName | name of subobject |
string | $sortkey | call-by-ref will be set to sortkey |
boolean | $canonical | should redirects be resolved? |
boolean | $fetchHashes | should the property hashes be obtained and cached? |
- Returns
- integer SMW id or 0 if there is none
SMWSql3SmwIds::makeDatabaseId |
( |
|
$title, |
|
|
|
$namespace, |
|
|
|
$iw, |
|
|
|
$subobjectName, |
|
|
|
$canonical, |
|
|
|
$sortkey, |
|
|
|
$fetchHashes |
|
) |
| |
|
protected |
Find the numeric ID used for the page of the given normalized title, namespace, interwiki, and subobjectName. Predefined IDs are not taken into account (however, they would still be found correctly by an avoidable database read if they are stored correctly in the database; this should always be the case). In all other aspects, the method works just like makeSMWPageID(). Especially, if no ID exists, a new ID is created and returned.
- Since
- 1.8
- Parameters
-
string | $title | DB key |
integer | $namespace | namespace |
string | $iw | interwiki prefix |
string | $subobjectName | name of subobject |
boolean | $canonical | should redirects be resolved? |
string | $sortkey | call-by-ref will be set to sortkey |
boolean | $fetchHashes | should the property hashes be obtained and cached? |
- Returns
- integer SMW id or 0 if there is none
SMWSql3SmwIds::makeSMWPageID |
( |
|
$title, |
|
|
|
$namespace, |
|
|
|
$iw, |
|
|
|
$subobjectName, |
|
|
|
$canonical = true , |
|
|
|
$sortkey = '' , |
|
|
|
$fetchHashes = false |
|
) |
| |
Find the numeric ID used for the page of the given title, namespace, interwiki, and subobjectName. If $canonical is set to true, redirects are taken into account to find the canonical alias ID for the given page. If no such ID exists, a new ID is created and returned. In any case, the current sortkey is set to the given one unless $sortkey is empty.
- Note
- Using this with $canonical==false can make sense, especially when the title is a redirect target (we do not want chains of redirects). But it is of no relevance if the title does not have an id yet.
- Since
- 1.8
- Parameters
-
string | $title | DB key |
integer | $namespace | namespace |
string | $iw | interwiki prefix |
string | $subobjectName | name of subobject |
boolean | $canonical | should redirects be resolved? |
string | $sortkey | call-by-ref will be set to sortkey |
boolean | $fetchHashes | should the property hashes be obtained and cached? |
- Returns
- integer SMW id or 0 if there is none