Jump to content

Manual:NamespaceInfo.php: Difference between revisions

From mediawiki.org
Content deleted Content added
No edit summary
Tag: 2017 source edit
No edit summary
 
Line 1: Line 1:
{{MW file|NamespaceInfo.php|includes/title/
{{MW file|NamespaceInfo.php|includes/title/
|class1=NamespaceInfo
|class1=NamespaceInfo
}}
}}



Latest revision as of 01:22, 5 July 2024

A utility class for dealing with namespaces that encodes all the "magic" behaviors of them based on index. The textual names of the namespaces are handled by Language.php.

Instantiation[edit]

Example:

$namespaceInfo = MediaWikiServices::getInstance()->getNamespaceInfo(); 
$canonProjectNamespaceName = $namespaceInfo->getCanonicalName( 4 ); // Project

Public methods[edit]

@todo

  • isMovable()
  • isSubject()
  • isTalk()
  • getTalk()
  • getTalkPage()
  • canHaveTalkPage()
  • getSubject()
  • getSubjectPage()
  • getAssociated()
  • getAssociatedPage()
  • exists()
  • equals()
  • subjectEquals()
  • getCanonicalNamespaces()
  • getCanonicalName()
  • getCanonicalIndex()
  • getValidNamespaces()
  • hasTalkNamespace()
  • isContent()
  • wantSignatures()
  • isWatchable()
  • hasSubpages()
  • getContentNamespaces()
  • getSubjectNamespaces()
  • getTalkNamespaces()
  • isCapitalized()
  • hasGenderDistinction()
  • isNonincludable()
  • getNamespaceContentModel()
  • getCategoryLinkType()
  • getCommonNamespaces()
Deprecated or removed
  • getRestrictionLevels() - use PermissionManager::getNamespaceRestrictionLevels()