MediaWiki
master
NamespaceRestriction.php
Go to the documentation of this file.
1
<?php
9
namespace
MediaWiki\Block\Restriction
;
10
11
use
MediaWiki\Title\Title
;
12
13
class
NamespaceRestriction
extends
AbstractRestriction
{
14
18
public
const
TYPE
=
'ns'
;
19
23
public
const
TYPE_ID
= 2;
24
28
public
function
matches
(
Title
$title ) {
29
return
$this->
getValue
() === $title->
getNamespace
();
30
}
31
32
}
MediaWiki\Block\Restriction\AbstractRestriction
Definition
AbstractRestriction.php:11
MediaWiki\Block\Restriction\AbstractRestriction\getValue
getValue()
Get the value of the restriction.1.33 int
Definition
AbstractRestriction.php:80
MediaWiki\Block\Restriction\NamespaceRestriction
Definition
NamespaceRestriction.php:13
MediaWiki\Block\Restriction\NamespaceRestriction\TYPE
const TYPE
Definition
NamespaceRestriction.php:18
MediaWiki\Block\Restriction\NamespaceRestriction\TYPE_ID
const TYPE_ID
Definition
NamespaceRestriction.php:23
MediaWiki\Block\Restriction\NamespaceRestriction\matches
matches(Title $title)
Determine if a restriction matches a given title.1.33 bool
Definition
NamespaceRestriction.php:28
MediaWiki\Title\Title
Represents a title within MediaWiki.
Definition
Title.php:69
MediaWiki\Title\Title\getNamespace
getNamespace()
Get the namespace index, i.e.
Definition
Title.php:1037
MediaWiki\Block\Restriction
Definition
AbstractRestriction.php:9
includes
Block
Restriction
NamespaceRestriction.php
Generated on Sat Mar 14 2026 04:24:24 for MediaWiki by
1.10.0