|
MediaWiki master
|
Base class for block targets. More...
Inherits MediaWiki\DAO\WikiAwareEntity, and Stringable.
Inherited by MediaWiki\Block\AnonIpBlockTarget, MediaWiki\Block\AutoBlockTarget, MediaWiki\Block\RangeBlockTarget, and MediaWiki\Block\UserBlockTarget.

Public Member Functions | |
| __toString () | |
| equals (?BlockTarget $other) | |
| Compare this object with another one. | |
| getLegacyTuple () | |
| Get the target and type tuple conventionally returned by BlockUtils::parseBlockTarget() | |
| getLogPage () | |
| Get the title to be used when logging an action on this block. | |
| getSpecificity () | |
| Get the score of this block for purposes of choosing a more specific block, where lower is more specific. | |
| getType () | |
| Get one of the Block::TYPE_xxx constants associated with this target. | |
| getWikiId () | |
Get the ID of the wiki this page belongs to.
| |
| toString () | |
| Get the username, the IP address, range, or autoblock ID prefixed with a "#". | |
| validateForCreation () | |
| Check the target data against more stringent requirements imposed when a block is created from user input. | |
Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity | |
| assertWiki ( $wikiId) | |
| Throws if $wikiId is different from the return value of getWikiId(). | |
Protected Member Functions | |
| __construct (string|false $wikiId) | |
| getLegacyUnion () | |
| Get the first part of the legacy tuple. | |
Protected Attributes | |
| string false | $wikiId |
Additional Inherited Members | |
Public Attributes inherited from MediaWiki\DAO\WikiAwareEntity | |
| const | LOCAL = false |
| Wiki ID value to use with instances that are defined relative to the local wiki. | |
|
protected |
| string | false | $wikiId | UserIdentity and Block extend WikiAwareEntity and so we must ask for a wiki ID as well, to forward it through, even though we don't use it. |
Definition at line 27 of file BlockTarget.php.
References MediaWiki\Block\BlockTarget\$wikiId.
| MediaWiki\Block\BlockTarget::__toString | ( | ) |
Definition at line 36 of file BlockTarget.php.
References MediaWiki\Block\BlockTarget\toString().
| MediaWiki\Block\BlockTarget::equals | ( | ?BlockTarget | $other | ) |
Compare this object with another one.
| BlockTarget | null | $other |
Definition at line 46 of file BlockTarget.php.
References MediaWiki\Block\BlockTarget\toString().
Referenced by MediaWiki\Block\BlockPermissionChecker\checkBlockPermissions().
| MediaWiki\Block\BlockTarget::getLegacyTuple | ( | ) |
Get the target and type tuple conventionally returned by BlockUtils::parseBlockTarget()
Definition at line 98 of file BlockTarget.php.
|
abstractprotected |
Get the first part of the legacy tuple.
Reimplemented in MediaWiki\Block\AnonIpBlockTarget, MediaWiki\Block\AutoBlockTarget, MediaWiki\Block\RangeBlockTarget, and MediaWiki\Block\UserBlockTarget.
|
abstract |
Get the title to be used when logging an action on this block.
For an autoblock, the title is technically invalid, with a hash character in the DB key. For a range block, the title is valid but is not a user page for a specific user.
See also getUserPage(), which exists only for subclasses which relate to a specific user with a talk page.
Reimplemented in MediaWiki\Block\AnonIpBlockTarget, MediaWiki\Block\AutoBlockTarget, MediaWiki\Block\RangeBlockTarget, and MediaWiki\Block\UserBlockTarget.
|
abstract |
Get the score of this block for purposes of choosing a more specific block, where lower is more specific.
Reimplemented in MediaWiki\Block\AnonIpBlockTarget, MediaWiki\Block\AutoBlockTarget, MediaWiki\Block\RangeBlockTarget, and MediaWiki\Block\UserBlockTarget.
|
abstract |
Get one of the Block::TYPE_xxx constants associated with this target.
Reimplemented in MediaWiki\Block\AnonIpBlockTarget, MediaWiki\Block\AutoBlockTarget, MediaWiki\Block\RangeBlockTarget, and MediaWiki\Block\UserBlockTarget.
| MediaWiki\Block\BlockTarget::getWikiId | ( | ) |
Get the ID of the wiki this page belongs to.
Implements MediaWiki\DAO\WikiAwareEntity.
Definition at line 32 of file BlockTarget.php.
References MediaWiki\Block\BlockTarget\$wikiId.
|
abstract |
Get the username, the IP address, range, or autoblock ID prefixed with a "#".
Such a string will round-trip through BlockTarget::newFromString(), giving back the same target.
Reimplemented in MediaWiki\Block\AnonIpBlockTarget, MediaWiki\Block\AutoBlockTarget, MediaWiki\Block\RangeBlockTarget, and MediaWiki\Block\UserBlockTarget.
Referenced by MediaWiki\Block\BlockTarget\__toString(), and MediaWiki\Block\BlockTarget\equals().
|
abstract |
Check the target data against more stringent requirements imposed when a block is created from user input.
This is in addition to the loose validation done by BlockTargetFactory::newFromString().
Reimplemented in MediaWiki\Block\AnonIpBlockTarget, MediaWiki\Block\AutoBlockTarget, MediaWiki\Block\RangeBlockTarget, and MediaWiki\Block\UserBlockTarget.
|
protected |