MediaWiki  master
Block.php
Go to the documentation of this file.
1 <?php
2 
22 namespace MediaWiki\Block;
23 
27 
40 interface Block extends WikiAwareEntity {
41 
42  # TYPE constants
43  # Do not introduce negative constants without changing BlockUser command object.
44  public const TYPE_USER = 1;
45  public const TYPE_IP = 2;
46  public const TYPE_RANGE = 3;
47  public const TYPE_AUTO = 4;
48  public const TYPE_ID = 5;
49 
56  public function getId( $wikiId = self::LOCAL ): ?int;
57 
67  public function getIdentifier( $wikiId = self::LOCAL );
68 
74  public function getBlocker(): ?UserIdentity;
75 
82 
89  public function getTargetUserIdentity(): ?UserIdentity;
90 
98  public function getTargetName(): string;
99 
107  public function isBlocking( $target ): bool;
108 
114  public function getExpiry(): string;
115 
120  public function getType(): ?int;
121 
127  public function getTimestamp(): string;
128 
136  public function isSitewide(): bool;
137 
145  public function isCreateAccountBlocked(): bool;
146 
154  public function isHardblock(): bool;
155 
156 }
Value object for a comment stored by CommentStore.
Represents a block that may prevent users from performing specific operations.
Definition: Block.php:40
isSitewide()
Indicates that the block is a sitewide block.
isHardblock()
Returns whether the block is a hardblock (affects logged-in users on a given IP/range)
getBlocker()
Get the user who applied this block.
getTimestamp()
Get the timestamp indicating when the block was created.
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,...
getIdentifier( $wikiId=self::LOCAL)
Get the information that identifies this block, such that a user could look up everything that can be...
isBlocking( $target)
Determines whether this block is blocking the given target (and only that target).
getId( $wikiId=self::LOCAL)
Get the block ID.
getReasonComment()
Get the reason for creating the block.
isCreateAccountBlocked()
Get the flag indicating whether this block blocks the target from creating an account.
getType()
Get the type of target for this particular block.
getExpiry()
Get the block expiry time.
Marker interface for entities aware of the wiki they belong to.
Interface for objects representing user identity.