MediaWiki master
|
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, TitleFormatter $titleFormatter, Language $contentLanguage, GenderCache $genderCache, IConnectionProvider $dbProvider, LinksMigration $linksMigration, TempUserDetailsLookup $tempUserDetailsLookup, LoggerInterface $logger) | |
add ( $ns, $dbkey) | |
addObj ( $link) | |
addResultToCache ( $cache, $res) | |
Add a result wrapper containing IDs and titles to a LinkCache object. | |
addUser (UserIdentity $user) | |
Convenience function to add user and user talk pages for a given user to this batch. | |
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. | |
getPageIdentities () | |
Do the query, add the results to the LinkCache object, and return ProperPageIdentity instances corresponding to the pages in the batch. | |
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) | |
Set the function name to attribute database queries to, in debug logs. | |
Public Attributes | |
array< int, array< string, mixed > > | $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 | |
string null | $caller |
For debugging which method is using this class. | |
Class representing a list of titles The execute() method checks them all for existence and adds them to a LinkCache object.
Definition at line 50 of file LinkBatch.php.
MediaWiki\Cache\LinkBatch::__construct | ( | iterable | $arr, |
LinkCache | $linkCache, | ||
TitleFormatter | $titleFormatter, | ||
Language | $contentLanguage, | ||
GenderCache | $genderCache, | ||
IConnectionProvider | $dbProvider, | ||
LinksMigration | $linksMigration, | ||
TempUserDetailsLookup | $tempUserDetailsLookup, | ||
LoggerInterface | $logger ) |
iterable<LinkTarget>|iterable<PageReference> | $arr Initial items to be added to the batch | |
LinkCache | $linkCache | |
TitleFormatter | $titleFormatter | |
Language | $contentLanguage | |
GenderCache | $genderCache | |
IConnectionProvider | $dbProvider | |
LinksMigration | $linksMigration | |
TempUserDetailsLookup | $tempUserDetailsLookup | |
LoggerInterface | $logger |
Definition at line 118 of file LinkBatch.php.
References MediaWiki\Cache\LinkBatch\addObj().
MediaWiki\Cache\LinkBatch::add | ( | $ns, | |
$dbkey ) |
int | $ns | |
string | $dbkey |
Definition at line 200 of file LinkBatch.php.
MediaWiki\Cache\LinkBatch::addObj | ( | $link | ) |
LinkTarget | PageReference | $link |
Definition at line 174 of file LinkBatch.php.
References MediaWiki\Linker\LinkTarget\isExternal().
Referenced by MediaWiki\Cache\LinkBatch\__construct().
MediaWiki\Cache\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 290 of file LinkBatch.php.
MediaWiki\Cache\LinkBatch::addUser | ( | UserIdentity | $user | ) |
Convenience function to add user and user talk pages for a given user to this batch.
Calling execute
will also prefetch the expiration status of temporary accounts added this way, which is needed for the efficient rendering of user links via UserLinkRenderer.
Definition at line 164 of file LinkBatch.php.
MediaWiki\Cache\LinkBatch::constructSet | ( | $prefix, | |
$db ) |
Construct a WHERE clause which will match all the given titles.
It is the caller's responsibility to only call this if the LinkBatch is not empty, because there is no safe way to represent a SQL conditional for the empty set.
string | $prefix | The appropriate table's field name prefix ('page', 'pl', etc) |
ISQLPlatform | $db | DB object to use |
Definition at line 403 of file LinkBatch.php.
MediaWiki\Cache\LinkBatch::doGenderQuery | ( | ) |
Do (and cache) {{GENDER:...}} information for userpages in this LinkBatch.
Definition at line 382 of file LinkBatch.php.
MediaWiki\Cache\LinkBatch::doQuery | ( | ) |
Perform the existence test query, return a result wrapper with page_id fields.
Definition at line 357 of file LinkBatch.php.
MediaWiki\Cache\LinkBatch::execute | ( | ) |
Do the query and add the results to the LinkCache object.
Definition at line 241 of file LinkBatch.php.
|
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 267 of file LinkBatch.php.
MediaWiki\Cache\LinkBatch::getPageIdentities | ( | ) |
Do the query, add the results to the LinkCache object, and return ProperPageIdentity instances corresponding to the pages in the batch.
Definition at line 252 of file LinkBatch.php.
MediaWiki\Cache\LinkBatch::getSize | ( | ) |
MediaWiki\Cache\LinkBatch::isEmpty | ( | ) |
Returns true if no pages have been added, false otherwise.
Definition at line 223 of file LinkBatch.php.
MediaWiki\Cache\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<int,array<string,mixed>> | $array |
Definition at line 214 of file LinkBatch.php.
MediaWiki\Cache\LinkBatch::setCaller | ( | $caller | ) |
Set the function name to attribute database queries to, in debug logs.
string | $caller |
Definition at line 151 of file LinkBatch.php.
|
protected |
For debugging which method is using this class.
Definition at line 69 of file LinkBatch.php.
array<int,array<string,mixed> > MediaWiki\Cache\LinkBatch::$data = [] |
2-d array, first index namespace, second index dbkey, value arbitrary
Definition at line 54 of file LinkBatch.php.