|
MediaWiki master
|
Helper class for API modules that display block information. More...
Public Member Functions | |
| getBlockCode (Block $block) | |
| Get the API error code, to be used in ApiMessage::create or ApiBase::dieWithError. | |
| getBlockDetails (Block $block, Language $language, UserIdentity $user, bool $canSeeHiddenBlocks=false) | |
| Get basic info about a given block. | |
Helper class for API modules that display block information.
Intended for use via composition.
Definition at line 26 of file ApiBlockInfoHelper.php.
| MediaWiki\Api\ApiBlockInfoHelper::getBlockCode | ( | Block | $block | ) |
Get the API error code, to be used in ApiMessage::create or ApiBase::dieWithError.
| Block | $block |
Definition at line 120 of file ApiBlockInfoHelper.php.
References if.
| MediaWiki\Api\ApiBlockInfoHelper::getBlockDetails | ( | Block | $block, |
| Language | $language, | ||
| UserIdentity | $user, | ||
| bool | $canSeeHiddenBlocks = false ) |
Get basic info about a given block.
| Block | $block | |
| Language | $language | |
| UserIdentity | $user | |
| bool | $canSeeHiddenBlocks | Whether the viewer has the hideuser right (since 1.47). Set this only after you check the right. |
Definition at line 53 of file ApiBlockInfoHelper.php.
References MediaWiki\Api\ApiResult\formatExpiry(), MediaWiki\Language\Language\formatExpiry(), getBlockDetails(), MediaWiki\Block\Block\getBlocker(), MediaWiki\Block\Block\getExpiry(), MediaWiki\Language\Language\getHumanTimestamp(), MediaWiki\Block\Block\getId(), MediaWiki\Block\Block\getReasonComment(), MediaWiki\Block\Block\getTimestamp(), MediaWiki\Block\Block\isCreateAccountBlocked(), MediaWiki\Block\Block\isEmailBlocked(), MediaWiki\Block\Block\isHardblock(), MediaWiki\Block\Block\isSitewide(), and wfTimestamp().
Referenced by getBlockDetails().