MediaWiki master
|
Backend class for blocking utils. More...
Public Member Functions | |
__construct (BlockTargetFactory $blockTargetFactory) | |
parseBlockTarget ( $target) | |
From string specification or UserIdentity, get the block target and the type of target. | |
parseBlockTargetRow ( $row) | |
From a row which must contain bt_auto, bt_user, bt_address and bl_id, and optionally bt_user_text, determine the block target and type. | |
validateTarget ( $value) | |
Validate block target. | |
Backend class for blocking utils.
This service should contain any methods that are useful to more than one blocking-related class and don't fit any other service.
For now, this includes only
parsing the target and type of a block in the database
Definition at line 42 of file BlockUtils.php.
MediaWiki\Block\BlockUtils::__construct | ( | BlockTargetFactory | $blockTargetFactory | ) |
Definition at line 45 of file BlockUtils.php.
MediaWiki\Block\BlockUtils::parseBlockTarget | ( | $target | ) |
From string specification or UserIdentity, get the block target and the type of target.
Note that, except for null, it is always safe to treat the target as a string; for UserIdentityValue objects this will return UserIdentityValue::__toString() which in turn gives UserIdentityValue::getName().
If the type is not null, it will be an AbstractBlock::TYPE_ constant.
Since 1.42, it is no longer safe to pass a value from the database field ipb_address/bt_address to this method, since the username is normalized. Use parseBlockTargetRow() instead. (T346683)
string | UserIdentity | null | $target |
Definition at line 67 of file BlockUtils.php.
MediaWiki\Block\BlockUtils::parseBlockTargetRow | ( | $row | ) |
From a row which must contain bt_auto, bt_user, bt_address and bl_id, and optionally bt_user_text, determine the block target and type.
\\stdClass | $row |
Definition at line 84 of file BlockUtils.php.
MediaWiki\Block\BlockUtils::validateTarget | ( | $value | ) |
Validate block target.
string | UserIdentity | $value |
Definition at line 100 of file BlockUtils.php.