* Insert a block into the block table. Will fail if there is a conflicting
* block (same name and options) already in the database.
*
- * @param DatabaseBase $dbw If you have one available
+ * @param IDatabase $dbw If you have one available
* @return bool|array False on failure, assoc array on success:
* ('id' => block ID, 'autoIds' => array of autoblock IDs)
*/
/**
* Get an array suitable for passing to $dbw->insert() or $dbw->update()
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @return array
*/
protected function getDatabaseArray( $db = null ) {
* make additional queries to pull source data while the
* main query is still running.
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param int|array $history One of WikiExporter::FULL, WikiExporter::CURRENT,
* WikiExporter::RANGE or WikiExporter::STABLE, or an associative array:
* - offset: non-inclusive offset at which to start the query
* Load a page revision from a given revision ID number.
* Returns null if no such revision can be found.
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param int $id
* @return Revision|null
*/
* that's attached to a given page. If not attached
* to that page, will return null.
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param int $pageid
* @param int $id
* @return Revision|null
* that's attached to a given page. If not attached
* to that page, will return null.
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param Title $title
* @param int $id
* @return Revision|null
* WARNING: Timestamps may in some circumstances not be unique,
* so this isn't the best key to use.
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param Title $title
* @param string $timestamp
* @return Revision|null
* Given a set of conditions, fetch a revision from
* the given database connection.
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param array $conditions
* @param int $flags (optional)
* @return Revision|null
* which will return matching database rows with the
* fields necessary to build Revision objects.
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param array $conditions
* @param int $flags (optional)
* @return ResultWrapper
/**
* Do a batched query to get the parent revision lengths
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param array $revIds
* @return array
*/
* Get previous revision Id for this page_id
* This is used to populate rev_parent_id on save
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @return int
*/
private function getPreviousRevisionId( $db ) {
* Insert a new revision into the database, returning the new revision ID
* number on success and dies horribly on failure.
*
- * @param DatabaseBase $dbw (master connection)
+ * @param IDatabase $dbw (master connection)
* @throws MWException
* @return int
*/
* Such revisions can for instance identify page rename
* operations and other such meta-modifications.
*
- * @param DatabaseBase $dbw
+ * @param IDatabase $dbw
* @param int $pageId ID number of the page to read from
* @param string $summary Revision's summary
* @param bool $minor Whether the revision should be considered as minor
/**
* Get count of revisions per page...not very efficient
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param int $id Page id
* @return int
*/
/**
* Get count of revisions per page...not very efficient
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param Title $title
* @return int
*/
* @since 1.20
* @deprecated since 1.24
*
- * @param DatabaseBase|int $db The Database to perform the check on. May be given as a
+ * @param IDatabase|int $db The Database to perform the check on. May be given as a
* Database object or a database identifier usable with wfGetDB.
* @param int $pageId The ID of the page in question
* @param int $userId The ID of the user in question
/**
* Do the DB query to iterate through the objects.
- * @param DatabaseBase $db DatabaseBase object to use for the query
+ * @param IDatabase $db DatabaseBase object to use for the query
*/
abstract public function doQuery( $db );
}
/**
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @return mixed
*/
public function doQuery( $db ) {
}
/**
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @return bool|ResultWrapper
*/
static function doLoad( $db ) {
* Do all updates and commit them. More or less a replacement
* for the original initStats, but without output.
*
- * @param DatabaseBase|bool $database
+ * @param IDatabase|bool $database
* - Boolean: whether to use the master DB
* - DatabaseBase: database connection to use
* @param array $options Array of options, may contain the following values
/**
* Get the last touched timestamp
*
- * @param DatabaseBase $db Optional db
+ * @param IDatabase $db Optional db
* @return string Last-touched timestamp
*/
public function getTouched( $db = null ) {
*
* @see newFromId()
* @see newFromName()
- * @param DatabaseBase $db Db connection
+ * @param IDatabase $db Db connection
* @param string $database Database name
* @param string $name User name
* @param int $id User ID
/**
* @deprecated since 1.25, always returns empty string
- * @param DatabaseBase|bool $db
+ * @param IDatabase|bool $db
* @return string
*/
public function getModuleProfileName( $db = false ) {
* Note that the query result must include the columns returned by
* $this->getPageTableFields().
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param ResultWrapper $queryResult Query result object
*/
public function populateFromQueryResult( $db, $queryResult ) {
/**
* Set the Database object to use
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
*/
public function setDB( $db ) {
$this->db = $db;
* Construct a WHERE clause which will match all the given titles.
*
* @param string $prefix The appropriate table's field name prefix ('page', 'pl', etc)
- * @param DatabaseBase $db DatabaseBase object to use
+ * @param IDatabase $db DatabaseBase object to use
* @return string|bool String with SQL where clause fragment, or false if no items.
*/
public function constructSet( $prefix, $db ) {
}
/**
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @return mixed
*/
public function doQuery( $db ) {
}
/**
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @return mixed
*/
public function doQuery( $db ) {
}
/**
- * @param DatabaseBase $dbw
+ * @param IDatabase $dbw
* @return bool|mixed
*/
public static function cacheUpdate( $dbw ) {
/**
* Get the 'blobs' table name for this database
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @return string Table name ('blobs' by default)
*/
function getTable( $db ) {
}
/**
- * @param DatabaseBase $dbr
+ * @param IDatabase $dbr
* @param string $fname
* @return array|bool
*/
/**
* SQL clause to skip forbidden log types for this user
*
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @param string $audience Public/user
* @param User $user User to check, or null to use $wgUser
* @return string|bool String on success, false on failure.
/**
* Fetch a page record with the given conditions
- * @param DatabaseBase $dbr
+ * @param IDatabase $dbr
* @param array $conditions
* @param array $options
* @return object|bool Database result resource, or false on failure
* Fetch a page record matching the Title object's namespace and title
* using a sanitized title string
*
- * @param DatabaseBase $dbr
+ * @param IDatabase $dbr
* @param Title $title
* @param array $options
* @return object|bool Database result resource, or false on failure
/**
* Fetch a page record matching the requested ID
*
- * @param DatabaseBase $dbr
+ * @param IDatabase $dbr
* @param int $id
* @param array $options
* @return object|bool Database result resource, or false on failure
* or else the record will be left in a funky state.
* Best if all done inside a transaction.
*
- * @param DatabaseBase $dbw
+ * @param IDatabase $dbw
* @return int|bool The newly created page_id key; false if the title already existed
*/
public function insertOn( $dbw ) {
/**
* Update the page record to point to a newly saved revision.
*
- * @param DatabaseBase $dbw
+ * @param IDatabase $dbw
* @param Revision $revision For ID number, and text used to set
* length and redirect status fields
* @param int $lastRevision If given, will not overwrite the page field
/**
* Add row to the redirect table if this is a redirect, remove otherwise.
*
- * @param DatabaseBase $dbw
+ * @param IDatabase $dbw
* @param Title $redirectTitle Title object pointing to the redirect target,
* or NULL if this is not a redirect
* @param null|bool $lastRevIsRedirect If given, will optimize adding and
*
* @deprecated since 1.24, use updateRevisionOn instead
*
- * @param DatabaseBase $dbw
+ * @param IDatabase $dbw
* @param Revision $revision
* @return bool
*/
*/
class SearchDatabase extends SearchEngine {
/**
- * @var DatabaseBase Slave database for reading from for results
+ * @var IDatabase Slave database for reading from for results
*/
protected $db;
/**
* Constructor
- * @param DatabaseBase $db The database to search from
+ * @param IDatabase $db The database to search from
*/
- public function __construct( DatabaseBase $db = null ) {
+ public function __construct( IDatabase $db = null ) {
if ( $db ) {
$this->db = $db;
} else {
private $key;
/**
- * @param DatabaseBase $db The database to read from
+ * @param IDatabase $db The database to read from
* @param string $table The name of the table to read from
* @param string|array $primaryKey The name or names of the primary key columns
* @param integer $batchSize The number of rows to fetch per iteration
* @throws MWException
*/
- public function __construct( DatabaseBase $db, $table, $primaryKey, $batchSize ) {
+ public function __construct( IDatabase $db, $table, $primaryKey, $batchSize ) {
if ( $batchSize < 1 ) {
throw new MWException( 'Batch size must be at least 1 row.' );
}
protected $clusterName;
/**
- * @param DatabaseBase $db The database to write to
+ * @param IDatabase $db The database to write to
* @param string $table The name of the table to update
* @param string|bool $clusterName A cluster name valid for use with LBFactory
*/
- public function __construct( DatabaseBase $db, $table, $clusterName = false ) {
+ public function __construct( IDatabase $db, $table, $clusterName = false ) {
$this->db = $db;
$this->table = $table;
$this->clusterName = $clusterName;