42 private $currentCategoryCounts;
51 parent::__construct(
'Wantedcategories' );
59 'tables' => [
'categorylinks',
'page' ],
65 'conds' => [
'page_title' => null ],
66 'options' => [
'GROUP BY' =>
'cl_to' ],
67 'join_conds' => [
'page' => [
'LEFT JOIN',
68 [
'page_title = cl_to',
74 parent::preprocessResults( $db, $res );
76 $this->currentCategoryCounts = [];
78 if ( !$res->numRows() || !$this->isCached() ) {
86 foreach ( $res as $row ) {
87 $allCategories[] = $row->title;
90 $categoryRes = $db->newSelectQueryBuilder()
91 ->select( [
'cat_title',
'cat_pages' ] )
93 ->where( [
'cat_title' => $allCategories ] )
94 ->caller( __METHOD__ )->fetchResultSet();
95 foreach ( $categoryRes as $row ) {
96 $this->currentCategoryCounts[$row->cat_title] = intval( $row->cat_pages );
109 $nt = Title::makeTitle( $result->namespace, $result->title );
111 $text =
new HtmlArmor( $this->languageConverter->convertHtml( $nt->getText() ) );
119 $nlinks = $this->
msg(
'nmembers' )->numParams( $result->value )->escaped();
123 $currentValue = $this->currentCategoryCounts[$result->title] ?? 0;
124 $cachedValue = intval( $result->value );
127 if ( $nt->isKnown() || $currentValue === 0 ) {
128 $plink =
"<del>$plink</del>";
132 if ( $currentValue !== $cachedValue ) {
133 $nlinks = $this->
msg(
'nmemberschanged' )
134 ->numParams( $cachedValue, $currentValue )->escaped();
136 $nlinks = $this->
msg(
'nmembers' )->numParams( $cachedValue )->escaped();
140 return $this->
getLanguage()->specialList( $plink, $nlinks );
144 return 'maintenance';
152class_alias( SpecialWantedCategories::class,
'SpecialWantedCategories' );
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.