parent::__construct();
$this->mTitle = $title;
- $this->mId = $title->getArticleID( Title::GAID_FOR_UPDATE );
+
+ if ( !$this->mId ) {
+ // NOTE: subclasses may initialize mId before calling this constructor!
+ $this->mId = $title->getArticleID( Title::GAID_FOR_UPDATE );
+ }
if ( !$this->mId ) {
throw new InvalidArgumentException(
$insertBatches = array_chunk( $insertions, $bSize );
foreach ( $insertBatches as $insertBatch ) {
- $this->getDB()->insert( $table, $insertBatch, __METHOD__, 'IGNORE' );
+ $this->getDB()->insert( $table, $insertBatch, __METHOD__, [ 'IGNORE' ] );
$lbf->commitAndWaitForReplication(
__METHOD__, $this->ticket, [ 'domain' => $domainId ]
);
$nt = Title::makeTitleSafe( NS_CATEGORY, $name );
$contLang->findVariantLink( $name, $nt, true );
- $type = MWNamespace::getCategoryLinkType( $this->mTitle->getNamespace() );
+ $type = MediaWikiServices::getInstance()->getNamespaceInfo()->
+ getCategoryLinkType( $this->mTitle->getNamespace() );
# Treat custom sortkeys as a prefix, so that if multiple
# things are forced to sort as '*' or something, they'll
/**
* @return IDatabase
*/
- private function getDB() {
+ protected function getDB() {
if ( !$this->db ) {
$this->db = wfGetDB( DB_MASTER );
}
}
return [
- 'wiki' => WikiMap::getWikiIdFromDbDomain( $this->getDB()->getDomainID() ),
+ 'domain' => $this->getDB()->getDomainID(),
'job' => new JobSpecification(
'refreshLinksPrioritized',
[