$mCategories, //!< Map of category names to sort keys
$mInterlangs, //!< Map of language codes to titles
$mProperties, //!< Map of arbitrary name to value
+ $mDb, //!< Database connection reference
+ $mOptions, //!< SELECT options to be used (array)
$mRecursive; //!< Whether to queue jobs for recursive updates
/**
* @param $title Title of the page we're updating
* @param $parserOutput ParserOutput: output from a full parse of this page
* @param $recursive Boolean: queue jobs for recursive updates?
+ * @throws MWException
*/
function __construct( $title, $parserOutput, $recursive = true ) {
- parent::__construct( );
+ parent::__construct( false ); // no implicit transaction
if ( !( $title instanceof Title ) ) {
throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " .
**/
class LinksDeletionUpdate extends SqlDataUpdate {
- protected $mTitle; //!< Title the title of page that was deleted
+ protected $mPage; //!< WikiPage the wikipage that was deleted
/**
* Constructor
*
* @param $page WikiPage Page we are updating
*/
- function __construct( Title $title ) {
- parent::__construct( );
+ function __construct( WikiPage $page ) {
+ parent::__construct( false ); // no implicit transaction
- $this->mTitle = $title;
+ $this->mPage = $page;
- if ( !$title->getArticleID() ) {
- throw new MWException( "The Title object did not provide an article ID. Perhaps the page doesn't exist?" );
+ if ( !$page->exists() ) {
+ throw new MWException( "Page ID not known, perhaps the page doesn't exist?" );
}
}
* Do some database updates after deletion
*/
public function doUpdate() {
- $title = $this->mTitle;
- $id = $title->getArticleID();
+ $title = $this->mPage->getTitle();
+ $id = $this->mPage->getId();
# Delete restrictions for it
$this->mDb->delete( 'page_restrictions', array ( 'pr_page' => $id ), __METHOD__ );
$cats [] = $row->cl_to;
}
- $this->updateCategoryCounts( array(), $cats );
+ $this->mPage->updateCategoryCounts( array(), $cats );
# If using cascading deletes, we can skip some explicit deletes
if ( !$this->mDb->cascadingDeletes() ) {