Semantic MediaWiki and related extensions
|
Public Member Functions | |
__construct (SQLStore $store) | |
setFieldTypeFeatures ( $fieldTypeFeatures) | |
hasFeature ( $feature) | |
isDbType ( $dbType) | |
getTableFields () | |
getFetchFields () | |
getTableIndexes () | |
getIndexHint ( $key) | |
getWhereConds (DataItem $dataItem) | |
getInsertValues (DataItem $dataItem) | |
getIndexField () | |
getLabelField () | |
getSortField () | |
dataItemFromDBKeys ( $dbkeys) | |
newFromDBKeys ( $dbkeys) | |
Public Attributes | |
const | IHINT_PSUBJECTS = 'ihint.psubjects' |
Protected Attributes | |
$store | |
$fieldTypeFeatures = false | |
Classes extending this represent all store layout that is known about a certain dataitem
GNU GPL v2+
SMW\SQLStore\EntityStore\DataItemHandler::__construct | ( | SQLStore | $store | ) |
SQLStore | $store |
|
abstract |
Create a dataitem from an array of DB keys or a single DB key string. May throw an DataItemException if the given DB keys cannot be converted back into a dataitem. Each implementation of this method must otherwise run without errors for both array and string inputs.
array | string | $dbkeys |
DataItemException |
|
abstract |
Return an array with all the field names and types that need to be retrieved from the database in order to create a dataitem using dataItemFromDBKeys(). The result format is the same as for getTableFields(), but usually with fewer field names.
|
abstract |
Return the field used to select this type of DataItem. In particular, this identifies the column that is used to sort values of this kind. Every type of data returns a non-empty string here.
SMW\SQLStore\EntityStore\DataItemHandler::getIndexHint | ( | $key | ) |
Provides a possibility to return a specific index hint for a domain.
string | $key |
|
abstract |
Return an array of fields=>values that is to be inserted when writing the given DataItem to the database. Values should be set for all columns, even if NULL. This array is used to perform all insert operations into the DB.
DataItem | $dataItem |
|
abstract |
Return the label field for this type of DataItem. This should be a string column in the database table that can be used for selecting values using criteria such as "starts with". The return value can be empty if this is not supported. This is preferred for DataItem classes that do not have an obvious canonical string writing anyway.
The return value can be a column name or the empty string (if the give type of DataItem does not have a label field).
SMW\SQLStore\EntityStore\DataItemHandler::getSortField | ( | ) |
Returns the expected sort field.
|
abstract |
Return array of fields for a DI type.
Tables declare value columns ("object fields") by specifying their name and type. Types are given using letters:
SMW\SQLStore\EntityStore\DataItemHandler::getTableIndexes | ( | ) |
Return an array of additional indexes that should be provided for the table using this DI handler. By default, SMWSQLStore3 will already create indexes for all standard select operations, based on the indexfield provided by getIndexField(). Hence, most handlers do not need to define any indexes.
|
abstract |
Return an array of fields=>values to conditions (WHERE part) in SQL queries for the given DataItem. This method can return fewer fields than getInstertValues as long as they are enough to identify an item for search.
DataItem | $dataItem |
SMW\SQLStore\EntityStore\DataItemHandler::hasFeature | ( | $feature | ) |
integer | $feature |
SMW\SQLStore\EntityStore\DataItemHandler::isDbType | ( | $dbType | ) |
boolean |
SMW\SQLStore\EntityStore\DataItemHandler::newFromDBKeys | ( | $dbkeys | ) |
array | string | $dbkeys |
DataItemException |
SMW\SQLStore\EntityStore\DataItemHandler::setFieldTypeFeatures | ( | $fieldTypeFeatures | ) |
integer | $fieldTypeFeatures |
const SMW\SQLStore\EntityStore\DataItemHandler::IHINT_PSUBJECTS = 'ihint.psubjects' |
Specifies a property subject index hint.