MediaWiki  REL1_19
LinkBatch Class Reference

Class representing a list of titles The execute() method checks them all for existence and adds them to a LinkCache object. More...

List of all members.

Public Member Functions

 __construct ($arr=array())
 add ($ns, $dbkey)
 addObj ($title)
 addResultToCache ($cache, $res)
 Add a ResultWrapper 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 ResultWrapper 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 = array()
 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.

Detailed Description

Class representing a list of titles The execute() method checks them all for existence and adds them to a LinkCache object.

Definition at line 9 of file LinkBatch.php.


Constructor & Destructor Documentation

LinkBatch::__construct ( arr = array())

Definition at line 20 of file LinkBatch.php.

References addObj().

Here is the call graph for this function:


Member Function Documentation

LinkBatch::addObj ( title)
Parameters:
$titleTitle

Definition at line 40 of file LinkBatch.php.

References $title, add(), and wfDebug().

Referenced by __construct(), Linker\formatTemplates(), CategoryPager\getBody(), UsersPager\getBody(), and ResourceLoaderWikiModule\getTitleMtimes().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
$cacheLinkCache
$res
Returns:
Array of remaining titles

Definition at line 123 of file LinkBatch.php.

References $res, $title, and Title\makeTitle().

Referenced by executeInto().

Here is the call graph for this function:

Here is the caller graph for this function:

LinkBatch::constructSet ( prefix,
db 
)

Construct a WHERE clause which will match all the given titles.

Parameters:
$prefixString: the appropriate table's field name prefix ('page', 'pl', etc)
$dbDatabaseBase object to use
Returns:
mixed string with SQL where clause fragment, or false if no items.

Definition at line 204 of file LinkBatch.php.

Referenced by doQuery().

Here is the caller graph for this function:

Do (and cache) {{GENDER:...}} information for userpages in this LinkBatch.

Returns:
bool whether the query was successful

Definition at line 182 of file LinkBatch.php.

References $wgContLang, isEmpty(), and GenderCache\singleton().

Referenced by executeInto().

Here is the call graph for this function:

Here is the caller graph for this function:

Perform the existence test query, return a ResultWrapper with page_id fields.

Returns:
Bool|ResultWrapper

Definition at line 154 of file LinkBatch.php.

References $caller, $dbr, $res, constructSet(), isEmpty(), wfGetDB(), wfProfileIn(), and wfProfileOut().

Referenced by executeInto().

Here is the call graph for this function:

Here is the caller graph for this function:

Do the query and add the results to the LinkCache object.

Returns:
Array mapping PDBK to ID

Definition at line 92 of file LinkBatch.php.

References executeInto(), and LinkCache\singleton().

Here is the call graph for this function:

LinkBatch::executeInto ( &$  cache) [protected]

Do the query and add the results to a given LinkCache object Return an array mapping PDBK to ID.

Parameters:
$cacheLinkCache
Returns:
Array remaining IDs

Definition at line 104 of file LinkBatch.php.

References $res, addResultToCache(), doGenderQuery(), doQuery(), wfProfileIn(), and wfProfileOut().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the size of the batch.

Returns:
int

Definition at line 83 of file LinkBatch.php.

Referenced by isEmpty().

Here is the caller graph for this function:

Returns true if no pages have been added, false otherwise.

Returns:
bool

Definition at line 74 of file LinkBatch.php.

References getSize().

Referenced by doGenderQuery(), and doQuery().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
$arrayarray

Definition at line 65 of file LinkBatch.php.

Referenced by TitleListDependency\getLinkBatch().

Here is the caller graph for this function:

LinkBatch::setCaller ( caller)

Use ->setCaller( __METHOD__ ) to indicate which code is using this class.

Only used in debugging output.

Since:
1.17
Parameters:
$caller

Definition at line 33 of file LinkBatch.php.

References $caller.


Member Data Documentation

LinkBatch::$caller [protected]

For debugging which method is using this class.

Definition at line 18 of file LinkBatch.php.

Referenced by doQuery(), and setCaller().

LinkBatch::$data = array()

2-d array, first index namespace, second index dbkey, value arbitrary

Definition at line 13 of file LinkBatch.php.


The documentation for this class was generated from the following file: