29 private $currentCategoryCounts;
38 parent::__construct(
'Wantedcategories' );
47 'tables' => [
'categorylinks',
'linktarget',
'page' ],
50 'title' =>
'lt_title',
53 'conds' => [
'page_title' => null ],
54 'options' => [
'GROUP BY' =>
'lt_title' ],
56 'linktarget' => [
'JOIN', [
'cl_target_id = lt_id' ] ],
57 'page' => [
'LEFT JOIN', [
'page_title = lt_title',
'page_namespace' =>
NS_CATEGORY ] ]
65 CategoryLinksTable::VIRTUAL_DOMAIN,
72 parent::preprocessResults( $db, $res );
74 $this->currentCategoryCounts = [];
76 if ( !$res->numRows() || !$this->isCached() ) {
84 foreach ( $res as $row ) {
85 $allCategories[] = $row->title;
88 $categoryRes = $db->newSelectQueryBuilder()
89 ->select( [
'cat_title',
'cat_pages' ] )
91 ->where( [
'cat_title' => $allCategories ] )
92 ->caller( __METHOD__ )->fetchResultSet();
93 foreach ( $categoryRes as $row ) {
94 $this->currentCategoryCounts[$row->cat_title] = intval( $row->cat_pages );
109 $text =
new HtmlArmor( $this->languageConverter->convertHtml( $nt->getText() ) );
117 $nlinks = $this->
msg(
'nmembers' )->numParams( $result->value )->escaped();
121 $currentValue = $this->currentCategoryCounts[$result->title] ?? 0;
122 $cachedValue = intval( $result->value );
125 if ( $nt->isKnown() || $currentValue === 0 ) {
126 $plink =
"<del>$plink</del>";
130 if ( $currentValue !== $cachedValue ) {
131 $nlinks = $this->
msg(
'nmemberschanged' )
132 ->numParams( $cachedValue, $currentValue )->escaped();
134 $nlinks = $this->
msg(
'nmembers' )->numParams( $cachedValue )->escaped();
138 return $this->
getLanguage()->specialList( $plink, $nlinks );
143 return 'maintenance';
151class_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.