+ $expiry = $db->encodeExpiry( $this->mExpiry );
+
+ $a = array(
+ 'ipb_address' => (string)$this->target,
+ 'ipb_user' => $this->target instanceof User ? $this->target->getID() : 0,
+ 'ipb_by' => $this->getBy(),
+ 'ipb_by_text' => $this->getByName(),
+ 'ipb_reason' => $this->mReason,
+ 'ipb_timestamp' => $db->timestamp( $this->mTimestamp ),
+ 'ipb_auto' => $this->mAuto,
+ 'ipb_anon_only' => !$this->isHardblock(),
+ 'ipb_create_account' => $this->prevents( 'createaccount' ),
+ 'ipb_enable_autoblock' => $this->isAutoblocking(),
+ 'ipb_expiry' => $expiry,
+ 'ipb_range_start' => $this->getRangeStart(),
+ 'ipb_range_end' => $this->getRangeEnd(),
+ 'ipb_deleted' => intval( $this->mHideName ), // typecast required for SQLite
+ 'ipb_block_email' => $this->prevents( 'sendemail' ),
+ 'ipb_allow_usertalk' => !$this->prevents( 'editownusertalk' )
+ );