MediaWiki  1.34.0
WikiCategoryPage.php
Go to the documentation of this file.
1 <?php
26 class WikiCategoryPage extends WikiPage {
27 
35  public function hasViewableContent() {
36  if ( parent::hasViewableContent() ) {
37  return true;
38  } else {
39  $cat = Category::newFromTitle( $this->mTitle );
40  // If any of these are not 0, then has members
41  if ( $cat->getPageCount()
42  || $cat->getSubcatCount()
43  || $cat->getFileCount()
44  ) {
45  return true;
46  }
47  }
48  return false;
49  }
50 
58  public function isHidden() {
59  $pageId = $this->getTitle()->getArticleID();
60  $pageProps = PageProps::getInstance()->getProperties( $this->getTitle(), 'hiddencat' );
61 
62  return isset( $pageProps[$pageId] );
63  }
64 
72  public function isExpectedUnusedCategory() {
73  $pageId = $this->getTitle()->getArticleID();
74  $pageProps = PageProps::getInstance()->getProperties( $this->getTitle(), 'expectunusedcategory' );
75 
76  return isset( $pageProps[$pageId] );
77  }
78 }
WikiPage
Class representing a MediaWiki article and history.
Definition: WikiPage.php:47
WikiCategoryPage\isExpectedUnusedCategory
isExpectedUnusedCategory()
Checks if a category is expected to be an unused category.
Definition: WikiCategoryPage.php:72
WikiCategoryPage
Special handling for category pages.
Definition: WikiCategoryPage.php:26
PageProps\getInstance
static getInstance()
Definition: PageProps.php:66
WikiPage\getTitle
getTitle()
Get the title object of the article.
Definition: WikiPage.php:298
Category\newFromTitle
static newFromTitle( $title)
Factory function.
Definition: Category.php:146
WikiCategoryPage\hasViewableContent
hasViewableContent()
Don't return a 404 for categories in use.
Definition: WikiCategoryPage.php:35
WikiCategoryPage\isHidden
isHidden()
Checks if a category is hidden.
Definition: WikiCategoryPage.php:58