MediaWiki
1.28.0
|
Class representing a list of titles The execute() method checks them all for existence and adds them to a LinkCache object. More...
Public Member Functions | |
__construct ($arr=[]) | |
LinkBatch constructor. More... | |
add ($ns, $dbkey) | |
addObj ($linkTarget) | |
addResultToCache ($cache, $res) | |
Add a ResultWrapper containing IDs and titles to a LinkCache object. More... | |
constructSet ($prefix, $db) | |
Construct a WHERE clause which will match all the given titles. More... | |
doGenderQuery () | |
Do (and cache) {{GENDER:...}} information for userpages in this LinkBatch. More... | |
doQuery () | |
Perform the existence test query, return a ResultWrapper with page_id fields. More... | |
execute () | |
Do the query and add the results to the LinkCache object. More... | |
getSize () | |
Returns the size of the batch. More... | |
isEmpty () | |
Returns true if no pages have been added, false otherwise. More... | |
setArray ($array) | |
Set the link list to a given 2-d array First key is the namespace, second is the DB key, value arbitrary. More... | |
setCaller ($caller) | |
Use ->setCaller( METHOD ) to indicate which code is using this class. More... | |
Public Attributes | |
$data = [] | |
2-d array, first index namespace, second index dbkey, value arbitrary More... | |
Protected Member Functions | |
executeInto (&$cache) | |
Do the query and add the results to a given LinkCache object Return an array mapping PDBK to ID. More... | |
Protected Attributes | |
$caller | |
For debugging which method is using this class. More... | |
Class representing a list of titles The execute() method checks them all for existence and adds them to a LinkCache object.
Definition at line 32 of file LinkBatch.php.
LinkBatch::__construct | ( | $arr = [] | ) |
LinkBatch constructor.
LinkTarget[] | $arr Initial items to be added to the batch |
Definition at line 47 of file LinkBatch.php.
LinkBatch::add | ( | $ns, | |
$dbkey | |||
) |
int | $ns | |
string | $dbkey |
Definition at line 79 of file LinkBatch.php.
References data.
Referenced by addObj(), ProtectedTitlesPager\getStartBody(), LogPager\getStartBody(), and ProtectedPagesPager\preprocessResults().
LinkBatch::addObj | ( | $linkTarget | ) |
LinkTarget | $linkTarget |
Definition at line 67 of file LinkBatch.php.
References add(), and wfDebug().
Referenced by __construct().
LinkBatch::addResultToCache | ( | $cache, | |
$res | |||
) |
Add a ResultWrapper containing IDs and titles to a LinkCache object.
As normal, titles will go into the static Title cache field. This function also stores extra fields of the title used for link parsing to avoid extra DB queries.
LinkCache | $cache | |
ResultWrapper | $res |
Definition at line 154 of file LinkBatch.php.
References $cache, $data, $res, $title, and as.
Referenced by executeInto().
LinkBatch::constructSet | ( | $prefix, | |
$db | |||
) |
Construct a WHERE clause which will match all the given titles.
string | $prefix | The appropriate table's field name prefix ('page', 'pl', etc) |
IDatabase | $db | DB object to use |
Definition at line 242 of file LinkBatch.php.
References data.
Referenced by doQuery().
LinkBatch::doGenderQuery | ( | ) |
Do (and cache) {{GENDER:...}} information for userpages in this LinkBatch.
Definition at line 219 of file LinkBatch.php.
References $wgContLang, data, global, and isEmpty().
Referenced by executeInto().
LinkBatch::doQuery | ( | ) |
Perform the existence test query, return a ResultWrapper with page_id fields.
Definition at line 189 of file LinkBatch.php.
References $caller, $dbr, $res, constructSet(), DB_REPLICA, LinkCache\getSelectFields(), isEmpty(), and wfGetDB().
Referenced by executeInto().
LinkBatch::execute | ( | ) |
Do the query and add the results to the LinkCache object.
Definition at line 123 of file LinkBatch.php.
References executeInto().
|
protected |
Do the query and add the results to a given LinkCache object Return an array mapping PDBK to ID.
LinkCache | $cache |
Definition at line 136 of file LinkBatch.php.
References $cache, $res, addResultToCache(), doGenderQuery(), and doQuery().
Referenced by execute().
LinkBatch::getSize | ( | ) |
Returns the size of the batch.
Definition at line 114 of file LinkBatch.php.
References data.
Referenced by isEmpty().
LinkBatch::isEmpty | ( | ) |
Returns true if no pages have been added, false otherwise.
Definition at line 105 of file LinkBatch.php.
References getSize().
Referenced by doGenderQuery(), and doQuery().
LinkBatch::setArray | ( | $array | ) |
Set the link list to a given 2-d array First key is the namespace, second is the DB key, value arbitrary.
array | $array |
Definition at line 96 of file LinkBatch.php.
References data.
Referenced by OutputPage\addCategoryLinks(), and ApiParse\formatCategoryLinks().
LinkBatch::setCaller | ( | $caller | ) |
Use ->setCaller( METHOD ) to indicate which code is using this class.
Only used in debugging output.
string | $caller |
Definition at line 60 of file LinkBatch.php.
References $caller.
Referenced by BlockListPager\preprocessResults().
|
protected |
For debugging which method is using this class.
Definition at line 41 of file LinkBatch.php.
Referenced by doQuery(), and setCaller().
LinkBatch::$data = [] |
2-d array, first index namespace, second index dbkey, value arbitrary
Definition at line 36 of file LinkBatch.php.
Referenced by addResultToCache().