30 private $currentCategoryCounts;
40 parent::__construct(
'Wantedcategories' );
48 $queryInfo = $this->linksMigration->getQueryInfo(
'categorylinks' );
49 $titleField = $this->linksMigration->getTitleFields(
'categorylinks' )[1];
52 'tables' => array_merge( $queryInfo[
'tables'], [
'page' ] ),
55 'title' => $titleField,
58 'conds' => [
'page_title' => null ],
59 'options' => [
'GROUP BY' => $titleField ],
60 'join_conds' => array_merge( $queryInfo[
'joins'],
61 [
'page' => [
'LEFT JOIN',
62 [
'page_title = ' . $titleField,
70 CategoryLinksTable::VIRTUAL_DOMAIN,
77 parent::preprocessResults( $db, $res );
79 $this->currentCategoryCounts = [];
81 if ( !$res->numRows() || !$this->isCached() ) {
89 foreach ( $res as $row ) {
90 $allCategories[] = $row->title;
93 $categoryRes = $db->newSelectQueryBuilder()
94 ->select( [
'cat_title',
'cat_pages' ] )
96 ->where( [
'cat_title' => $allCategories ] )
97 ->caller( __METHOD__ )->fetchResultSet();
98 foreach ( $categoryRes as $row ) {
99 $this->currentCategoryCounts[$row->cat_title] = intval( $row->cat_pages );
114 $text =
new HtmlArmor( $this->languageConverter->convertHtml( $nt->getText() ) );
122 $nlinks = $this->
msg(
'nmembers' )->numParams( $result->value )->escaped();
126 $currentValue = $this->currentCategoryCounts[$result->title] ?? 0;
127 $cachedValue = intval( $result->value );
130 if ( $nt->isKnown() || $currentValue === 0 ) {
131 $plink =
"<del>$plink</del>";
135 if ( $currentValue !== $cachedValue ) {
136 $nlinks = $this->
msg(
'nmemberschanged' )
137 ->numParams( $cachedValue, $currentValue )->escaped();
139 $nlinks = $this->
msg(
'nmembers' )->numParams( $cachedValue )->escaped();
143 return $this->
getLanguage()->specialList( $plink, $nlinks );
148 return 'maintenance';
156class_alias( SpecialWantedCategories::class,
'SpecialWantedCategories' );
Factory for LinkBatch objects to batch query page metadata.
setDatabaseProvider(IConnectionProvider $databaseProvider)
isCached()
Whether or not the output of the page in question is retrieved from the database cache.
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getContentLanguage()
Shortcut to get content language.
getLanguage()
Shortcut to get user's language.
Base class for a "wanted" query page like WantedPages, WantedTemplates, etc.