MediaWiki REL1_39
|
Public Member Functions | ||||
__construct ( $blockId, $value) | ||||
Create Restriction. | ||||
equals (Restriction $other) | ||||
Determine if a restriction equals another restriction.
| ||||
getBlockId () | ||||
Gets the id of the block.
| ||||
getHash () | ||||
Create a unique hash of the block restriction based on the type and value.
| ||||
getValue () | ||||
Gets the value of the restriction.
| ||||
setBlockId ( $blockId) | ||||
Sets 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 () | |||
Gets the type of restriction.
| ||||
static | getTypeId () | |||
Gets the id of the type of restriction.This id is used in the database.
| ||||
static | newFromRow (\stdClass $row) | |||
Creates 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 | ( | ) |
Gets 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 |
Gets 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 |
Gets 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 | ( | ) |
Gets 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 |
Creates 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 | ) |
Sets 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.