MediaWiki master
MediaWiki\Block\Restriction\PageRestriction Class Reference

Inherits MediaWiki\Block\Restriction\AbstractRestriction.

Collaboration diagram for MediaWiki\Block\Restriction\PageRestriction:

Public Member Functions

 getTitle ()
 
 matches (Title $title)
 Determine if a restriction matches a given title.
Since
1.33
Parameters
Title$title
Returns
bool

 
 setTitle (Title $title)
 
- Public Member Functions inherited from MediaWiki\Block\Restriction\AbstractRestriction
 __construct ( $blockId, $value)
 Create Restriction.
 
 equals (Restriction $other)
 Determine if a restriction equals another restriction.
Since
1.33
Parameters
Restriction$other
Returns
bool

 
 getBlockId ()
 Get the ID of the block.
Since
1.33
Returns
int

 
 getHash ()
 Create a unique hash of the block restriction based on the type and value.
Since
1.33
Returns
string

 
 getValue ()
 Get the value of the restriction.
Since
1.33
Returns
int

 
 setBlockId ( $blockId)
 Set the ID of the block.
Since
1.33
Parameters
int$blockId
Returns
self

 
 toRow ()
 Convert a restriction object into a row array for insertion.
Since
1.33
Returns
array

 

Static Public Member Functions

static newFromRow (\stdClass $row)
 Create a new Restriction from a database row.
Since
1.33
Parameters
\\stdClass$row
Returns
static

 
static newFromTitle ( $title)
 
- Static Public Member Functions inherited from MediaWiki\Block\Restriction\AbstractRestriction
static getType ()
 Get the type of restriction.
Since
1.33
Returns
string

 
static getTypeId ()
 Get the ID of the type of restriction.This ID is used in the database.
Since
1.33
Returns
int

 

Public Attributes

const TYPE = 'page'
 
const TYPE_ID = 1
 
- Public Attributes inherited from MediaWiki\Block\Restriction\AbstractRestriction
const TYPE = ''
 String constant identifying the type of restriction.
 
const TYPE_ID = 0
 Numeric type identifier.
 

Protected Attributes

Title false null $title
 
- Protected Attributes inherited from MediaWiki\Block\Restriction\AbstractRestriction
int $blockId
 
int $value
 

Detailed Description

Definition at line 27 of file PageRestriction.php.

Member Function Documentation

◆ getTitle()

MediaWiki\Block\Restriction\PageRestriction::getTitle ( )

◆ matches()

MediaWiki\Block\Restriction\PageRestriction::matches ( Title $title)

Determine if a restriction matches a given title.

Since
1.33
Parameters
Title$title
Returns
bool

Implements MediaWiki\Block\Restriction\Restriction.

Definition at line 47 of file PageRestriction.php.

References MediaWiki\Title\Title\equals(), and MediaWiki\Block\Restriction\PageRestriction\getTitle().

◆ newFromRow()

static MediaWiki\Block\Restriction\PageRestriction::newFromRow ( \stdClass $row)
static

Create a new Restriction from a database row.

Since
1.33
Parameters
\\stdClass$row
Returns
static

Reimplemented from MediaWiki\Block\Restriction\AbstractRestriction.

Definition at line 81 of file PageRestriction.php.

References MediaWiki\Block\Restriction\PageRestriction\$title.

◆ newFromTitle()

static MediaWiki\Block\Restriction\PageRestriction::newFromTitle ( $title)
static
Access: internal
Since
1.36
Parameters
string | Title$title
Returns
self

Definition at line 105 of file PageRestriction.php.

References MediaWiki\Block\Restriction\PageRestriction\$title, and MediaWiki\Title\Title\getArticleID().

◆ setTitle()

MediaWiki\Block\Restriction\PageRestriction::setTitle ( Title $title)
Since
1.33
Parameters
Title$title
Returns
self

Definition at line 60 of file PageRestriction.php.

References MediaWiki\Block\Restriction\PageRestriction\$title.

Member Data Documentation

◆ $title

◆ TYPE

const MediaWiki\Block\Restriction\PageRestriction::TYPE = 'page'

Definition at line 32 of file PageRestriction.php.

◆ TYPE_ID

const MediaWiki\Block\Restriction\PageRestriction::TYPE_ID = 1

Definition at line 37 of file PageRestriction.php.


The documentation for this class was generated from the following file: