MediaWiki master
|
Inherits MediaWiki\Block\Restriction\Restriction.
Inherited by MediaWiki\Block\Restriction\ActionRestriction, MediaWiki\Block\Restriction\NamespaceRestriction, and MediaWiki\Block\Restriction\PageRestriction.
Public Member Functions | ||||
__construct ( $blockId, $value) | ||||
Create Restriction. | ||||
equals (Restriction $other) | ||||
Determine if a restriction equals another restriction.
| ||||
getBlockId () | ||||
Get the ID of the block.
| ||||
getHash () | ||||
Create a unique hash of the block restriction based on the type and value.
| ||||
getValue () | ||||
Get the value of the restriction.
| ||||
setBlockId ( $blockId) | ||||
Set the ID of the block.
| ||||
toRow () | ||||
Convert a restriction object into a row array for insertion.
| ||||
Public Member Functions inherited from MediaWiki\Block\Restriction\Restriction | ||||
matches (Title $title) | ||||
Determine if a restriction matches a given title. | ||||
Static Public Member Functions | ||||
static | getType () | |||
Get the type of restriction.
| ||||
static | getTypeId () | |||
Get the ID of the type of restriction.This ID is used in the database.
| ||||
static | newFromRow (\stdClass $row) | |||
Create a new Restriction from a database row.
| ||||
Public Attributes | |
const | TYPE = '' |
String constant identifying the type of restriction. | |
const | TYPE_ID = 0 |
Numeric type identifier. | |
Protected Attributes | |
int | $blockId |
int | $value |
Definition at line 25 of file AbstractRestriction.php.
MediaWiki\Block\Restriction\AbstractRestriction::__construct | ( | $blockId, | |
$value ) |
Create Restriction.
int | $blockId | |
int | $value |
Definition at line 56 of file AbstractRestriction.php.
References MediaWiki\Block\Restriction\AbstractRestriction\$blockId, and MediaWiki\Block\Restriction\AbstractRestriction\$value.
MediaWiki\Block\Restriction\AbstractRestriction::equals | ( | Restriction | $other | ) |
Determine if a restriction equals another restriction.
Restriction | $other |
Implements MediaWiki\Block\Restriction\Restriction.
Definition at line 120 of file AbstractRestriction.php.
References MediaWiki\Block\Restriction\AbstractRestriction\getHash(), and MediaWiki\Block\Restriction\Restriction\getHash().
MediaWiki\Block\Restriction\AbstractRestriction::getBlockId | ( | ) |
Get the ID of the block.
Implements MediaWiki\Block\Restriction\Restriction.
Definition at line 78 of file AbstractRestriction.php.
References MediaWiki\Block\Restriction\AbstractRestriction\$blockId.
Referenced by MediaWiki\Block\Restriction\AbstractRestriction\toRow().
MediaWiki\Block\Restriction\AbstractRestriction::getHash | ( | ) |
Create a unique hash of the block restriction based on the type and value.
Implements MediaWiki\Block\Restriction\Restriction.
Definition at line 127 of file AbstractRestriction.php.
References MediaWiki\Block\Restriction\AbstractRestriction\getType(), and MediaWiki\Block\Restriction\AbstractRestriction\getValue().
Referenced by MediaWiki\Block\Restriction\AbstractRestriction\equals().
|
static |
Get the type of restriction.
Implements MediaWiki\Block\Restriction\Restriction.
Definition at line 64 of file AbstractRestriction.php.
Referenced by MediaWiki\Block\Restriction\AbstractRestriction\getHash().
|
static |
Get the ID of the type of restriction.This ID is used in the database.
Implements MediaWiki\Block\Restriction\Restriction.
Definition at line 71 of file AbstractRestriction.php.
Referenced by MediaWiki\Block\Restriction\AbstractRestriction\toRow().
MediaWiki\Block\Restriction\AbstractRestriction::getValue | ( | ) |
Get the value of the restriction.
Implements MediaWiki\Block\Restriction\Restriction.
Definition at line 94 of file AbstractRestriction.php.
References MediaWiki\Block\Restriction\AbstractRestriction\$value.
Referenced by MediaWiki\Block\Restriction\AbstractRestriction\getHash(), MediaWiki\Block\Restriction\NamespaceRestriction\matches(), and MediaWiki\Block\Restriction\AbstractRestriction\toRow().
|
static |
Create a new Restriction from a database row.
\\stdClass | $row |
Implements MediaWiki\Block\Restriction\Restriction.
Reimplemented in MediaWiki\Block\Restriction\PageRestriction.
Definition at line 101 of file AbstractRestriction.php.
MediaWiki\Block\Restriction\AbstractRestriction::setBlockId | ( | $blockId | ) |
Set the ID of the block.
int | $blockId |
Implements MediaWiki\Block\Restriction\Restriction.
Definition at line 85 of file AbstractRestriction.php.
References MediaWiki\Block\Restriction\AbstractRestriction\$blockId.
MediaWiki\Block\Restriction\AbstractRestriction::toRow | ( | ) |
Convert a restriction object into a row array for insertion.
Implements MediaWiki\Block\Restriction\Restriction.
Definition at line 109 of file AbstractRestriction.php.
References MediaWiki\Block\Restriction\AbstractRestriction\getBlockId(), MediaWiki\Block\Restriction\AbstractRestriction\getTypeId(), and MediaWiki\Block\Restriction\AbstractRestriction\getValue().
|
protected |
Definition at line 42 of file AbstractRestriction.php.
Referenced by MediaWiki\Block\Restriction\AbstractRestriction\__construct(), MediaWiki\Block\Restriction\AbstractRestriction\getBlockId(), and MediaWiki\Block\Restriction\AbstractRestriction\setBlockId().
|
protected |
Definition at line 47 of file AbstractRestriction.php.
Referenced by MediaWiki\Block\Restriction\AbstractRestriction\__construct(), and MediaWiki\Block\Restriction\AbstractRestriction\getValue().
const MediaWiki\Block\Restriction\AbstractRestriction::TYPE = '' |
String constant identifying the type of restriction.
Expected to be overridden in subclasses with a non-empty string value.
Definition at line 31 of file AbstractRestriction.php.
const MediaWiki\Block\Restriction\AbstractRestriction::TYPE_ID = 0 |
Numeric type identifier.
Expected to be overridden in subclasses with a non-zero integer number. Must not exceed 127 to fit into a TINYINT database field.
Definition at line 37 of file AbstractRestriction.php.
Referenced by MediaWiki\Specials\SpecialUnblock\execute().