MediaWiki
master
|
Public Member Functions | |
__construct (IReadableDatabase $db, PageStore $pageStore, ?LinkCache $linkCache=null) | |
fetchPageIds () | |
Returns an array of page ids matching the query. More... | |
fetchPageRecord () | |
Fetch a single PageRecord that matches specified criteria. More... | |
fetchPageRecordArray () | |
Fetch PageRecords for the specified query as an associative array, using page IDs as array keys. More... | |
fetchPageRecords () | |
Fetch PageRecords for the specified query. More... | |
orderByPageId (string $dir=self::SORT_ASC) | |
Order results by page id. More... | |
orderByTitle (string $dir=self::SORT_ASC) | |
Order results by namespace and title in $direction. More... | |
whereNamespace (int $namespace) | |
Find by provided namespace. More... | |
wherePageIds ( $pageIds) | |
Find by provided page ids. More... | |
whereTitlePrefix (int $namespace, string $prefix) | |
Find by provided prefix. More... | |
whereTitles (int $namespace, $pageTitles) | |
Find by provided page titles. More... | |
![]() | |
__construct (IReadableDatabase $db) | |
Only for use in subclasses. More... | |
acquireRowLocks () | |
Execute the query, but throw away the results. More... | |
andWhere ( $conds) | |
Add conditions to the query. More... | |
bigResult () | |
Enable the SQL_BIG_RESULT option. More... | |
bufferResult () | |
Enable the SQL_BUFFER_RESULT option. More... | |
buildGroupConcatField ( $delim) | |
Build a GROUP_CONCAT or equivalent statement for a query. More... | |
calcFoundRows () | |
Enable the SQL_CALC_FOUND_ROWS option. More... | |
caller ( $fname) | |
Set the method name to be included in an SQL comment. More... | |
conds ( $conds) | |
Add conditions to the query. More... | |
connection (IReadableDatabase $db) | |
Change the IReadableDatabase object the query builder is bound to. More... | |
distinct () | |
Enable the DISTINCT option. More... | |
estimateRowCount () | |
Estimate the number of rows in dataset. More... | |
explain () | |
Make the query be an EXPLAIN SELECT query instead of a SELECT query. More... | |
fetchField () | |
Run the constructed SELECT query, and return a single field extracted from the first result row. More... | |
fetchFieldValues () | |
Run the constructed SELECT query, and extract a single field from each result row, returning an array containing all the values. More... | |
fetchResultSet () | |
Run the constructed SELECT query and return all results. More... | |
fetchRow () | |
Run the constructed SELECT query, and return the first result row. More... | |
fetchRowCount () | |
Run the SELECT query, and return the number of results. More... | |
field ( $field, $alias=null) | |
Add a single field to the query, optionally with an alias. More... | |
fields ( $fields) | |
Add a field or an array of fields to the query. More... | |
forUpdate () | |
Enable the FOR UPDATE option. More... | |
from ( $table, $alias=null) | |
Add a single table to the SELECT query. More... | |
getQueryInfo ( $joinsName='join_conds') | |
Get an associative array describing the query in terms of its raw parameters to Database::select(). More... | |
getSQL () | |
Get the SQL query string which would be used by fetchResultSet(). More... | |
groupBy ( $group) | |
Add a GROUP BY clause. More... | |
having ( $having) | |
Add a HAVING clause. More... | |
ignoreIndex ( $index) | |
Set the IGNORE INDEX option. More... | |
joinConds (array $joinConds) | |
Manually append to the $join_conds array which will be passed to IReadableDatabase::select(). More... | |
limit ( $limit) | |
Set the query limit. More... | |
lockInShareMode () | |
Enable the LOCK IN SHARE MODE option. More... | |
newJoinGroup () | |
Create a parenthesized group of joins which can be added to the object like a table. More... | |
newSubquery () | |
Get an empty SelectQueryBuilder which can be used to build a subquery of this query. More... | |
offset ( $offset) | |
Set the offset. More... | |
option ( $name, $value=null) | |
Manually set an option in the $options array to be passed to IReadableDatabase::select() More... | |
options (array $options) | |
Manually set multiple options in the $options array to be passed to IReadableDatabase::select(). More... | |
orderBy ( $fields, $direction=null) | |
Set the ORDER BY clause. More... | |
queryInfo ( $info) | |
Set the query parameters to the given values, appending to the values which were already set. More... | |
rawTables ( $tables) | |
Given a table or table array as might be passed to Database::select(), append it to the existing tables, interpreting nested arrays as join groups. More... | |
select ( $fields) | |
Add a field or an array of fields to the query. More... | |
setMaxExecutionTime (int $time) | |
Set MAX_EXECUTION_TIME for queries. More... | |
smallResult () | |
Enable the SQL_SMALL_RESULT option. More... | |
straightJoinOption () | |
Enable the STRAIGHT_JOIN query option. More... | |
tables ( $tables) | |
Add multiple tables. More... | |
useIndex ( $index) | |
Set a USE INDEX option. More... | |
where ( $conds) | |
Add conditions to the query. More... | |
![]() | |
join ( $table, $alias=null, $conds=[]) | |
Inner join a table or group of tables. More... | |
leftJoin ( $table, $alias=null, $conds=[]) | |
Left join a table or group of tables. More... | |
straightJoin ( $table, $alias=null, $conds=[]) | |
Straight join a table or group of tables. More... | |
table ( $table, $alias=null) | |
Add a single table or a single parenthesized group. More... | |
Additional Inherited Members | |
![]() | |
getAutoAlias () | |
Get a table alias which is unique to this SelectQueryBuilder. More... | |
![]() | |
IReadableDatabase IReadableDatabase | $db |
array | $options = [] |
The options to be passed to IReadableDatabase::select() More... | |
![]() | |
array | $joinConds = [] |
$lastAlias | |
array | $tables = [] |
Definition at line 14 of file PageSelectQueryBuilder.php.
MediaWiki\Page\PageSelectQueryBuilder::__construct | ( | IReadableDatabase | $db, |
PageStore | $pageStore, | ||
?LinkCache | $linkCache = null |
||
) |
IReadableDatabase | $db | |
PageStore | $pageStore | |
LinkCache | null | $linkCache | A link cache to store any retrieved rows into |
Definition at line 29 of file PageSelectQueryBuilder.php.
References Wikimedia\Rdbms\SelectQueryBuilder\$db, and Wikimedia\Rdbms\JoinGroupBase\table().
MediaWiki\Page\PageSelectQueryBuilder::fetchPageIds | ( | ) |
Returns an array of page ids matching the query.
Definition at line 180 of file PageSelectQueryBuilder.php.
MediaWiki\Page\PageSelectQueryBuilder::fetchPageRecord | ( | ) |
Fetch a single PageRecord that matches specified criteria.
Definition at line 125 of file PageSelectQueryBuilder.php.
MediaWiki\Page\PageSelectQueryBuilder::fetchPageRecordArray | ( | ) |
Fetch PageRecords for the specified query as an associative array, using page IDs as array keys.
Definition at line 165 of file PageSelectQueryBuilder.php.
MediaWiki\Page\PageSelectQueryBuilder::fetchPageRecords | ( | ) |
Fetch PageRecords for the specified query.
Definition at line 145 of file PageSelectQueryBuilder.php.
MediaWiki\Page\PageSelectQueryBuilder::orderByPageId | ( | string | $dir = self::SORT_ASC | ) |
Order results by page id.
string | $dir | one of self::SORT_ACS or self::SORT_DESC |
Definition at line 115 of file PageSelectQueryBuilder.php.
MediaWiki\Page\PageSelectQueryBuilder::orderByTitle | ( | string | $dir = self::SORT_ASC | ) |
Order results by namespace and title in $direction.
string | $dir | one of self::SORT_ACS or self::SORT_DESC |
Definition at line 103 of file PageSelectQueryBuilder.php.
MediaWiki\Page\PageSelectQueryBuilder::whereNamespace | ( | int | $namespace | ) |
Find by provided namespace.
int | $namespace |
Definition at line 62 of file PageSelectQueryBuilder.php.
MediaWiki\Page\PageSelectQueryBuilder::wherePageIds | ( | $pageIds | ) |
Find by provided page ids.
int | int[] | $pageIds |
Definition at line 43 of file PageSelectQueryBuilder.php.
References Wikimedia\Rdbms\SelectQueryBuilder\conds().
MediaWiki\Page\PageSelectQueryBuilder::whereTitlePrefix | ( | int | $namespace, |
string | $prefix | ||
) |
Find by provided prefix.
int | $namespace | |
string | $prefix |
Definition at line 75 of file PageSelectQueryBuilder.php.
MediaWiki\Page\PageSelectQueryBuilder::whereTitles | ( | int | $namespace, |
$pageTitles | |||
) |
Find by provided page titles.
int | $namespace | |
string | string[] | $pageTitles |
Definition at line 89 of file PageSelectQueryBuilder.php.