protected function do_save( $comment ) {

		if ( ! $comment->comment_ID ) {
			$id = wp_insert_comment( wp_slash( $comment->to_array() ) );
		} else {
			if ( wp_update_comment( wp_slash( $comment->to_array() ) ) ) {
				$id = $comment->comment_ID;
			}
		}

		if ( empty( $id ) ) {
			throw new \InvalidArgumentException( 'Error encountered while saving WP_Comment.' );
		}

		return get_comment( $id );
	}
protected function do_save( $comment ) {

		if ( ! $comment->comment_ID ) {
			$id = wp_insert_comment( wp_slash( $comment->to_array() ) );
		} else {
			if ( wp_update_comment( wp_slash( $comment->to_array() ) ) ) {
				$id = $comment->comment_ID;
			}
		}

		if ( empty( $id ) ) {
			throw new \InvalidArgumentException( 'Error encountered while saving WP_Comment.' );
		}

		return get_comment( $id );
	}
protected function do_save ( $ comment ) { if ( ! $ comment -> comment_ID ) { $ id = wp_insert_comment ( wp_slash ( $ comment -> to_array ( ) ) ) ; } else { if ( wp_update_comment ( wp_slash ( $ comment -> to_array ( ) ) ) ) { $ id = $ comment -> comment_ID ; } } if ( empty ( $ id ) ) { throw new \ InvalidArgumentException ( 'Error encountered while saving WP_Comment.' ) ; } return get_comment ( $ id ) ; }
Do the saving for a comment.

@since 2.0

@param \WP_Comment $comment

@return \WP_Comment
Do the saving for a comment .