- # Create block object. Note that for a user block, ipb_address is only for display purposes
- # FIXME: Why do we need to pass fourteen optional parameters to do this!?!
- $block = new Block(
- $target, # IP address or User name
- $userId, # User id
- $wgUser->getId(), # Blocker id
- $data['Reason'][0], # Reason string
- wfTimestampNow(), # Block Timestamp
- 0, # Is this an autoblock (no)
- self::parseExpiryInput( $data['Expiry'] ), # Expiry time
- !$data['HardBlock'], # Block anon only
- $data['CreateAccount'],
- $data['AutoBlock'],
- $data['HideUser']
- );
-
+ # Create block object.
+ $block = new Block();
+ $block->setTarget( $target );
+ $block->setBlocker( $wgUser );
+ $block->mReason = $data['Reason'][0];
+ $block->mExpiry = self::parseExpiryInput( $data['Expiry'] );
+ $block->prevents( 'createaccount', $data['CreateAccount'] );