MediaWiki  master
Block.php
Go to the documentation of this file.
1 <?php
2 
22 namespace MediaWiki\Block;
23 
26 
37 interface Block {
38 
39  # TYPE constants
40  # Do not introduce negative constants without changing BlockUser command object.
41  public const TYPE_USER = 1;
42  public const TYPE_IP = 2;
43  public const TYPE_RANGE = 3;
44  public const TYPE_AUTO = 4;
45  public const TYPE_ID = 5;
46 
51  public function getId(): ?int;
52 
61  public function getIdentifier();
62 
68  public function getBlocker(): ?UserIdentity;
69 
76 
83  public function getTargetUserIdentity(): ?UserIdentity;
84 
92  public function getTargetName(): string;
93 
101  public function isBlocking( $target ): bool;
102 
108  public function getExpiry(): string;
109 
114  public function getType(): ?int;
115 
121  public function getTimestamp(): string;
122 
130  public function isSitewide(): bool;
131 
139  public function isCreateAccountBlocked(): bool;
140 
148  public function isHardblock(): bool;
149 
150 }
MediaWiki\Block
Definition: AbstractBlock.php:21
MediaWiki\Block\Block\getIdentifier
getIdentifier()
Get the information that identifies this block, such that a user could look up everything that can be...
MediaWiki\Block\Block\isBlocking
isBlocking( $target)
Determines whether this block is blocking the given target (and only that target).
MediaWiki\Block\Block\getBlocker
getBlocker()
Get the user who applied this block.
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition: UserIdentity.php:39
MediaWiki\Block\Block\getType
getType()
Get the type of target for this particular block.
MediaWiki\Block\Block\isSitewide
isSitewide()
Indicates that the block is a sitewide block.
MediaWiki\Block\Block\TYPE_ID
const TYPE_ID
Definition: Block.php:45
MediaWiki\Block\Block\TYPE_RANGE
const TYPE_RANGE
Definition: Block.php:43
MediaWiki\Block\Block
Represents a block that may prevent users from performing specific operations.
Definition: Block.php:37
MediaWiki\Block\Block\isHardblock
isHardblock()
Returns whether the block is a hardblock (affects logged-in users on a given IP/range)
MediaWiki\Block\Block\getId
getId()
Get the block ID.
MediaWiki\Block\Block\TYPE_AUTO
const TYPE_AUTO
Definition: Block.php:44
MediaWiki\Block\Block\TYPE_USER
const TYPE_USER
Definition: Block.php:41
MediaWiki\Block\Block\isCreateAccountBlocked
isCreateAccountBlocked()
Get the flag indicating whether this block blocks the target from creating an account.
MediaWiki\Block\Block\getTimestamp
getTimestamp()
Get the timestamp indicating when the block was created.
MediaWiki\Block\Block\getExpiry
getExpiry()
Get the block expiry time.
MediaWiki\Block\Block\getTargetName
getTargetName()
Return the name of the block target as a string.
MediaWiki\Block\Block\getReasonComment
getReasonComment()
Get the reason for creating the block.
CommentStoreComment
Value object for a comment stored by CommentStore.
Definition: CommentStoreComment.php:30
MediaWiki\Block\Block\TYPE_IP
const TYPE_IP
Definition: Block.php:42
MediaWiki\Block\Block\getTargetUserIdentity
getTargetUserIdentity()
Get the UserIdentity identifying the blocked user, if the target is indeed a user (that is,...