MediaWiki REL1_35
|
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 (iterable $arr=[], ?LinkCache $linkCache=null, ?TitleFormatter $titleFormatter=null, ?Language $contentLanguage=null, ?GenderCache $genderCache=null, ?ILoadBalancer $loadBalancer=null) | |
add ( $ns, $dbkey) | |
addObj ( $linkTarget) | |
addResultToCache ( $cache, $res) | |
Add a result wrapper containing IDs and titles to a LinkCache object. | |
constructSet ( $prefix, $db) | |
Construct a WHERE clause which will match all the given titles. | |
doGenderQuery () | |
Do (and cache) {{GENDER:...}} information for userpages in this LinkBatch. | |
doQuery () | |
Perform the existence test query, return a result wrapper with page_id fields. | |
execute () | |
Do the query and add the results to the LinkCache object. | |
getSize () | |
Returns the size of the batch. | |
isEmpty () | |
Returns true if no pages have been added, false otherwise. | |
setArray ( $array) | |
Set the link list to a given 2-d array First key is the namespace, second is the DB key, value arbitrary. | |
setCaller ( $caller) | |
Use ->setCaller( METHOD ) to indicate which code is using this class. | |
Public Attributes | |
$data = [] | |
2-d array, first index namespace, second index dbkey, value arbitrary | |
Protected Member Functions | |
executeInto ( $cache) | |
Do the query and add the results to a given LinkCache object Return an array mapping PDBK to ID. | |
Protected Attributes | |
$caller | |
For debugging which method is using this class. | |
Private Attributes | |
Language null | $contentLanguage |
GenderCache null | $genderCache |
LinkCache null | $linkCache |
ILoadBalancer null | $loadBalancer |
TitleFormatter null | $titleFormatter |
Class representing a list of titles The execute() method checks them all for existence and adds them to a LinkCache object.
Definition at line 35 of file LinkBatch.php.
LinkBatch::__construct | ( | iterable | $arr = [] , |
?LinkCache | $linkCache = null , |
||
?TitleFormatter | $titleFormatter = null , |
||
?Language | $contentLanguage = null , |
||
?GenderCache | $genderCache = null , |
||
?ILoadBalancer | $loadBalancer = null |
||
) |
Traversable | LinkTarget[] | $arr | Initial items to be added to the batch |
LinkCache | null | $linkCache | |
TitleFormatter | null | $titleFormatter | |
Language | null | $contentLanguage | |
GenderCache | null | $genderCache | |
ILoadBalancer | null | $loadBalancer |
Definition at line 80 of file LinkBatch.php.
References $contentLanguage, $genderCache, $linkCache, $loadBalancer, $titleFormatter, and addObj().
LinkBatch::add | ( | $ns, | |
$dbkey | |||
) |
int | $ns | |
string | $dbkey |
Definition at line 130 of file LinkBatch.php.
Referenced by addObj(), ChangesListSpecialPage\execute(), QueryPage\executeLBFromResultWrapper(), LogPager\getStartBody(), ProtectedTitlesPager\getStartBody(), InfoAction\pageInfo(), SpecialDoubleRedirects\preprocessResults(), SpecialListRedirects\preprocessResults(), and ProtectedPagesPager\preprocessResults().
LinkBatch::addObj | ( | $linkTarget | ) |
LinkTarget | $linkTarget |
Definition at line 118 of file LinkBatch.php.
References add(), and wfDebug().
Referenced by __construct(), CategoryPager\getBody(), and MediaWiki\Cache\LinkBatchFactory\newLinkBatch().
LinkBatch::addResultToCache | ( | $cache, | |
$res | |||
) |
Add a result wrapper 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 | |
IResultWrapper | $res |
Definition at line 203 of file LinkBatch.php.
References $cache, $res, $title, TitleValue\tryNew(), and wfLogWarning().
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 298 of file LinkBatch.php.
Referenced by doQuery().
LinkBatch::doGenderQuery | ( | ) |
Do (and cache) {{GENDER:...}} information for userpages in this LinkBatch.
Definition at line 277 of file LinkBatch.php.
References isEmpty().
Referenced by executeInto().
LinkBatch::doQuery | ( | ) |
Perform the existence test query, return a result wrapper with page_id fields.
Definition at line 247 of file LinkBatch.php.
References $caller, $dbr, $res, constructSet(), DB_REPLICA, and isEmpty().
Referenced by executeInto().
LinkBatch::execute | ( | ) |
Do the query and add the results to the LinkCache object.
Definition at line 174 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 185 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 165 of file LinkBatch.php.
Referenced by isEmpty().
LinkBatch::isEmpty | ( | ) |
Returns true if no pages have been added, false otherwise.
Definition at line 156 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 147 of file LinkBatch.php.
Referenced by OutputPage\addCategoryLinksToLBAndGetResult(), 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 109 of file LinkBatch.php.
References $caller.
Referenced by BlockListPager\preprocessResults().
|
protected |
For debugging which method is using this class.
Definition at line 44 of file LinkBatch.php.
Referenced by doQuery(), and setCaller().
|
private |
Definition at line 59 of file LinkBatch.php.
Referenced by __construct().
LinkBatch::$data = [] |
2-d array, first index namespace, second index dbkey, value arbitrary
Definition at line 39 of file LinkBatch.php.
|
private |
Definition at line 64 of file LinkBatch.php.
Referenced by __construct().
|
private |
Definition at line 49 of file LinkBatch.php.
Referenced by __construct().
|
private |
Definition at line 69 of file LinkBatch.php.
Referenced by __construct().
|
private |
Definition at line 54 of file LinkBatch.php.
Referenced by __construct().