* @file
*/
use MediaWiki\MediaWikiServices;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
use Wikimedia\Rdbms\IDatabase;
/**
* $this->getPageTableFields().
*
* @param IDatabase $db
- * @param ResultWrapper $queryResult
+ * @param IResultWrapper $queryResult
*/
public function populateFromQueryResult( $db, $queryResult ) {
$this->initFromQueryResult( $queryResult );
/**
* Iterate through the result of the query on 'page' table,
* and for each row create and store title object and save any extra fields requested.
- * @param ResultWrapper $res DB Query result
+ * @param IResultWrapper $res DB Query result
* @param array $remaining Array of either pageID or ns/title elements (optional).
* If given, any missing items will go to $mMissingPageIDs and $mMissingTitles
* @param bool $processTitles Must be provided together with $remaining.
ApiBase::dieDebug( __METHOD__, 'Missing $processTitles parameter when $remaining is provided' );
}
+ $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
+
$usernames = [];
if ( $res ) {
foreach ( $res as $row ) {
$this->processDbRow( $row );
// Need gender information
- if ( MWNamespace::hasGenderDistinction( $row->page_namespace ) ) {
+ if ( $nsInfo->hasGenderDistinction( $row->page_namespace ) ) {
$usernames[] = $row->page_title;
}
}
$this->mTitles[] = $title;
// need gender information
- if ( MWNamespace::hasGenderDistinction( $ns ) ) {
+ if ( $nsInfo->hasGenderDistinction( $ns ) ) {
$usernames[] = $dbkey;
}
}
// If the user can see deleted revisions, pull out the corresponding
// titles from the archive table and include them too. We ignore
// ar_page_id because deleted revisions are tied by title, not page_id.
- if ( $goodRemaining && $this->getUser()->isAllowed( 'deletedhistory' ) ) {
+ if ( $goodRemaining &&
+ $this->getPermissionManager()->userHasRight( $this->getUser(), 'deletedhistory' ) ) {
$tables = [ 'archive' ];
$fields = [ 'ar_rev_id', 'ar_namespace', 'ar_title' ];
$where = [ 'ar_rev_id' => array_keys( $goodRemaining ) ];
}
// Need gender information
- if ( MWNamespace::hasGenderDistinction( $titleObj->getNamespace() ) ) {
+ if (
+ MediaWikiServices::getInstance()->getNamespaceInfo()->
+ hasGenderDistinction( $titleObj->getNamespace() )
+ ) {
$usernames[] = $titleObj->getText();
}
}