MediaWiki  master
NamespaceRestriction.php
Go to the documentation of this file.
1 <?php
24 
26 
30  const TYPE = 'ns';
31 
35  const TYPE_ID = 2;
36 
40  public function matches( \Title $title ) {
41  return $this->getValue() === $title->getNamespace();
42  }
43 
44 }
MediaWiki\Block\Restriction\NamespaceRestriction\TYPE
const TYPE
Definition: NamespaceRestriction.php:30
MediaWiki\Block\Restriction\NamespaceRestriction\matches
matches(\Title $title)
Determine if a restriction matches a given title.1.33 bool
Definition: NamespaceRestriction.php:40
MediaWiki\Block\Restriction\NamespaceRestriction\TYPE_ID
const TYPE_ID
Definition: NamespaceRestriction.php:35
MediaWiki\Block\Restriction
Definition: AbstractRestriction.php:23
Title\getNamespace
getNamespace()
Get the namespace index, i.e.
Definition: Title.php:1053
$title
$title
Definition: testCompression.php:36
MediaWiki\Block\Restriction\AbstractRestriction
Definition: AbstractRestriction.php:25
MediaWiki\Block\Restriction\NamespaceRestriction
Definition: NamespaceRestriction.php:25
Title
Represents a title within MediaWiki.
Definition: Title.php:42
MediaWiki\Block\Restriction\AbstractRestriction\getValue
getValue()
Gets the value of the restriction.1.33 int
Definition: AbstractRestriction.php:94