MediaWiki REL1_40
|
Represents a block that may prevent users from performing specific operations. More...
Inherits MediaWiki\DAO\WikiAwareEntity.
Inherited by MediaWiki\Block\AbstractBlock.
Public Member Functions | |
getBlocker () | |
Get the user who applied this block. | |
getExpiry () | |
Get the block expiry time. | |
getId ( $wikiId=self::LOCAL) | |
Get the block ID. | |
getIdentifier ( $wikiId=self::LOCAL) | |
Get the information that identifies this block, such that a user could look up everything that can be found about this block. | |
getReasonComment () | |
Get the reason for creating the block. | |
getTargetName () | |
Return the name of the block target as a string. | |
getTargetUserIdentity () | |
Get the UserIdentity identifying the blocked user, if the target is indeed a user (that is, if getType() returns TYPE_USER). | |
getTimestamp () | |
Get the timestamp indicating when the block was created. | |
getType () | |
Get the type of target for this particular block. | |
isBlocking ( $target) | |
Determines whether this block is blocking the given target (and only that target). | |
isCreateAccountBlocked () | |
Get the flag indicating whether this block blocks the target from creating an account. | |
isHardblock () | |
Returns whether the block is a hardblock (affects logged-in users on a given IP/range) | |
isSitewide () | |
Indicates that the block is a sitewide block. | |
Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity | |
assertWiki ( $wikiId) | |
Throws if $wikiId is different from the return value of getWikiId(). | |
getWikiId () | |
Get the ID of the wiki this page belongs to. | |
Public Attributes | |
const | BLOCK_TYPES |
Map block types to strings, to allow convenient logging. | |
const | TYPE_AUTO = 4 |
const | TYPE_ID = 5 |
const | TYPE_IP = 2 |
const | TYPE_RANGE = 3 |
const | TYPE_USER = 1 |
Represents a block that may prevent users from performing specific operations.
The block may apply to a specific user, to a network address, network range, or some other aspect of a web request. The block may apply to the entire site, or may be limited to specific pages or namespaces.
Extends WikiAwareEntity since 1.38.
MediaWiki\Block\Block::getBlocker | ( | ) |
Get the user who applied this block.
Implemented in MediaWiki\Block\CompositeBlock, MediaWiki\Block\DatabaseBlock, and MediaWiki\Block\SystemBlock.
MediaWiki\Block\Block::getExpiry | ( | ) |
Get the block expiry time.
Implemented in MediaWiki\Block\AbstractBlock, and MediaWiki\Block\CompositeBlock.
MediaWiki\Block\Block::getId | ( | $wikiId = self::LOCAL | ) |
Get the block ID.
string | false | $wikiId | (since 1.38) |
Implemented in MediaWiki\Block\AbstractBlock, and MediaWiki\Block\DatabaseBlock.
MediaWiki\Block\Block::getIdentifier | ( | $wikiId = self::LOCAL | ) |
Get the information that identifies this block, such that a user could look up everything that can be found about this block.
Typically a scalar ID (integer or string), but can also return a list of IDs, or an associative array encoding a composite ID. Must be safe to serialize as JSON.
string | false | $wikiId | (since 1.38) |
Implemented in MediaWiki\Block\CompositeBlock, MediaWiki\Block\DatabaseBlock, and MediaWiki\Block\SystemBlock.
MediaWiki\Block\Block::getReasonComment | ( | ) |
Get the reason for creating the block.
Implemented in MediaWiki\Block\AbstractBlock.
MediaWiki\Block\Block::getTargetName | ( | ) |
Return the name of the block target as a string.
Depending on the type returned by get Type(), this could be a user name, an IP address or range, an internal ID, etc.
Implemented in MediaWiki\Block\AbstractBlock.
MediaWiki\Block\Block::getTargetUserIdentity | ( | ) |
Get the UserIdentity identifying the blocked user, if the target is indeed a user (that is, if getType() returns TYPE_USER).
Implemented in MediaWiki\Block\AbstractBlock.
MediaWiki\Block\Block::getTimestamp | ( | ) |
Get the timestamp indicating when the block was created.
Implemented in MediaWiki\Block\AbstractBlock.
MediaWiki\Block\Block::getType | ( | ) |
Get the type of target for this particular block.
Implemented in MediaWiki\Block\AbstractBlock, and MediaWiki\Block\DatabaseBlock.
Referenced by ApiBase\dieBlocked().
MediaWiki\Block\Block::isBlocking | ( | $target | ) |
Determines whether this block is blocking the given target (and only that target).
UserIdentity | string | $target |
Implemented in MediaWiki\Block\AbstractBlock.
MediaWiki\Block\Block::isCreateAccountBlocked | ( | ) |
Get the flag indicating whether this block blocks the target from creating an account.
(Note that the flag may be overridden depending on global configs.)
Referenced by MediaWiki\Block\CompositeBlock\__construct(), MediaWiki\Block\DatabaseBlock\__construct(), MediaWiki\Block\SystemBlock\appliesToPasswordReset(), MediaWiki\Block\DatabaseBlock\doAutoblock(), and MediaWiki\Block\DatabaseBlock\initFromRow().
MediaWiki\Block\Block::isHardblock | ( | ) |
Returns whether the block is a hardblock (affects logged-in users on a given IP/range)
Note that users are always hardblocked, since they're logged in by definition.
Referenced by MediaWiki\Block\AbstractBlock\__construct(), MediaWiki\Block\CompositeBlock\__construct(), and MediaWiki\Block\DatabaseBlock\initFromRow().
MediaWiki\Block\Block::isSitewide | ( | ) |
Indicates that the block is a sitewide block.
This means the user is prohibited from editing any page on the site (other than their own talk page).
Referenced by MediaWiki\Block\CompositeBlock\__construct(), MediaWiki\Block\DatabaseBlock\__construct(), ApiBase\dieBlocked(), MediaWiki\Block\DatabaseBlock\doAutoblock(), and MediaWiki\Block\DatabaseBlock\initFromRow().
const MediaWiki\Block\Block::BLOCK_TYPES |
const MediaWiki\Block\Block::TYPE_AUTO = 4 |
Definition at line 47 of file Block.php.
Referenced by MediaWiki\Block\UnblockUser\__construct().
const MediaWiki\Block\Block::TYPE_IP = 2 |
Definition at line 45 of file Block.php.
Referenced by MediaWiki\Block\DatabaseBlock\getRangeEnd(), MediaWiki\Block\DatabaseBlock\getRangeStart(), MediaWiki\Block\DatabaseBlock\newLoad(), and MediaWiki\Block\BlockUtils\parseBlockTarget().
const MediaWiki\Block\Block::TYPE_RANGE = 3 |
Definition at line 46 of file Block.php.
Referenced by MediaWiki\Block\DatabaseBlock\getRangeEnd(), MediaWiki\Block\DatabaseBlock\getRangeStart(), and MediaWiki\Block\DatabaseBlock\newLoad().
const MediaWiki\Block\Block::TYPE_USER = 1 |
Definition at line 44 of file Block.php.
Referenced by MediaWiki\Block\BlockUser\__construct(), MediaWiki\Block\DatabaseBlock\getRangeEnd(), MediaWiki\Block\DatabaseBlock\getRangeStart(), MediaWiki\Block\DatabaseBlock\newLoad(), and MediaWiki\Block\BlockUtils\parseBlockTarget().