Semantic MediaWiki and related extensions
|
Public Member Functions | |
__construct (array $printRequests, Query $query, array $results, Store $store, $furtherRes=false) | |
getFilterMap () | |
getFieldItemFinder () | |
setItemJournal (ItemJournal $itemJournal) | |
getItemJournal () | |
setFromCache ( $isFromCache) | |
setScoreSet (ScoreSet $scoreSet) | |
getScoreSet () | |
setExcerpts (Excerpts $excerpts) | |
getExcerpts () | |
isFromCache () | |
getStore () | |
getNext () | |
getCount () | |
getResults () | |
reset () | |
getQuery () | |
getColumnCount () | |
getPrintRequests () | |
getQueryString () | |
hasFurtherResults () | |
setCountValue ( $countValue) | |
getCountValue () | |
getErrors () | |
addErrors (array $errors) | |
getQueryLink ( $caption=false) | |
getLink () | |
setSerializerVersion ( $version) | |
serializeToArray () | |
toArray () | |
getHash ( $type=null) | |
Public Attributes | |
const | QUICK_HASH = 'quick' |
Protected Attributes | |
$mResults | |
$mPrintRequests | |
$mFurtherResults | |
$mQuery | |
$mStore | |
Objects of this class encapsulate the result of a query in SMW. They provide access to the query result and printed data, and to some relevant query parameters that were used.
Standard access is provided through the iterator function getNext(), which returns an array ("table row") of ResultArray objects ("table cells"). It is also possible to access the set of result pages directly using getResults(). This is useful for printers that disregard printouts and only are interested in the actual list of pages.
GNU GPL v2+
SMW\Query\QueryResult::__construct | ( | array | $printRequests, |
Query | $query, | ||
array | $results, | ||
Store | $store, | ||
$furtherRes = false |
|||
) |
PrintRequest[] | $printRequests | |
Query | $query | |
DIWikiPage[] | $results | |
Store | $store | |
boolean | $furtherRes |
SMW\Query\QueryResult::addErrors | ( | array | $errors | ) |
Adds an array of erros.
array | $errors |
SMW\Query\QueryResult::getColumnCount | ( | ) |
Return the number of columns of result values that each row in this result set contains.
SMW\Query\QueryResult::getCount | ( | ) |
Return number of available results.
SMW\Query\QueryResult::getCountValue | ( | ) |
SMW\Query\QueryResult::getErrors | ( | ) |
Return error array, possibly empty.
SMW\Query\QueryResult::getExcerpts | ( | ) |
SMW\Query\QueryResult::getFieldItemFinder | ( | ) |
SMW\Query\QueryResult::getFilterMap | ( | ) |
SMW\Query\QueryResult::getHash | ( | $type = null | ) |
Returns result hash value
SMW\Query\QueryResult::getItemJournal | ( | ) |
SMW\Query\QueryResult::getLink | ( | ) |
Returns an SMWInfolink object with the QueryResults print requests as parameters.
SMW\Query\QueryResult::getNext | ( | ) |
Return the next result row as an array of ResultArray objects, and advance the internal pointer.
SMW\Query\QueryResult::getPrintRequests | ( | ) |
Return array of print requests (needed for printout since they contain property labels).
SMW\Query\QueryResult::getQuery | ( | ) |
Returns the query object of the current result set
SMW\Query\QueryResult::getQueryLink | ( | $caption = false | ) |
Create an SMWInfolink object representing a link to further query results. This link can then be serialised or extended by further params first. The optional $caption can be used to set the caption of the link (though this can also be changed afterwards with SMWInfolink::setCaption()). If empty, the message 'smw_iq_moreresults' is used as a caption.
string | false | $caption |
SMW\Query\QueryResult::getQueryString | ( | ) |
Returns the query string defining the conditions for the entities to be returned.
SMW\Query\QueryResult::getResults | ( | ) |
Return an array of SMWDIWikiPage objects that make up the results stored in this object.
SMW\Query\QueryResult::getScoreSet | ( | ) |
SMW\Query\QueryResult::hasFurtherResults | ( | ) |
Would there be more query results that were not shown due to a limit?
SMW\Query\QueryResult::isFromCache | ( | ) |
SMW\Query\QueryResult::reset | ( | ) |
SMW\Query\QueryResult::serializeToArray | ( | ) |
SMW\Query\QueryResult::setCountValue | ( | $countValue | ) |
integer | $countValue |
SMW\Query\QueryResult::setExcerpts | ( | Excerpts | $excerpts | ) |
Only available by some stores that support the retrieval of excerpts.
Excerpts | $excerpts |
SMW\Query\QueryResult::setFromCache | ( | $isFromCache | ) |
boolean | $isFromCache |
SMW\Query\QueryResult::setItemJournal | ( | ItemJournal | $itemJournal | ) |
ItemJournal | $itemJournal |
SMW\Query\QueryResult::setScoreSet | ( | ScoreSet | $scoreSet | ) |
Only available by some stores that support the computation of scores.
ScoreSet | $scoreSet |
SMW\Query\QueryResult::setSerializerVersion | ( | $version | ) |
SMW\Query\QueryResult::toArray | ( | ) |
Returns a serialized QueryResult object with additional meta data
This methods extends the serializeToArray() for additional meta that are useful when handling data via the api
const SMW\Query\QueryResult::QUICK_HASH = 'quick' |
When generating a hash just iterates over available subjects, not the entire object structure.