LinkBatch Class Reference
[Cache]

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())
 addObj ($title)
 add ($ns, $dbkey)
 setArray ($array)
 Set the link list to a given 2-d array First key is the namespace, second is the DB key, value arbitrary.
 isEmpty ()
 Returns true if no pages have been added, false otherwise.
 getSize ()
 Returns the size of the batch.
 execute ()
 Do the query and add the results to the LinkCache object Return an array mapping PDBK to ID.
 addResultToCache ($cache, $res)
 Add a ResultWrapper containing IDs and titles to a LinkCache object.
 doQuery ()
 Perform the existence test query, return a ResultWrapper with page_id fields.
 constructSet ($prefix, &$db)
 Construct a WHERE clause which will match all the given titles.

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.


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 15 of file LinkBatch.php.

References addObj().


Member Function Documentation

LinkBatch::add ( ns,
dbkey 
)

Definition at line 29 of file LinkBatch.php.

References $ns.

Referenced by addObj().

LinkBatch::addObj ( title  ) 

Definition at line 21 of file LinkBatch.php.

References $title, 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.

Definition at line 89 of file LinkBatch.php.

References $ns, $res, $row, $title, and Title::makeTitle().

Referenced by executeInto().

LinkBatch::constructSet ( prefix,
&$  db 
)

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

Parameters:
string $prefix the appropriate table's field name prefix ('page', 'pl', etc)
Returns:
string
Access:
public

Definition at line 149 of file LinkBatch.php.

References $db, $ns, and $sql.

Referenced by doQuery().

LinkBatch::doQuery (  ) 

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

Definition at line 119 of file LinkBatch.php.

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

Referenced by executeInto().

LinkBatch::execute (  ) 

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

Definition at line 66 of file LinkBatch.php.

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

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

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

Definition at line 75 of file LinkBatch.php.

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

Referenced by execute().

LinkBatch::getSize (  ) 

Returns the size of the batch.

Definition at line 58 of file LinkBatch.php.

Referenced by isEmpty().

LinkBatch::isEmpty (  ) 

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

Definition at line 51 of file LinkBatch.php.

References getSize().

Referenced by 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.

Definition at line 44 of file LinkBatch.php.


Member Data Documentation

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:

Generated on Sat Sep 5 02:08:40 2009 for MediaWiki by  doxygen 1.5.9