original_string: public function doDelete($data, Form $form) {
          $record=$this->currentPage();
      
          if($record->canDelete()) {
              Session::set('CodeBank.deletedSnippetID', $record->ID);
              $record->delete();
      
              $this->response->addHeader('X-Status', rawurlencode(_t('CodeBank.SNIPPET_DELETED', '_Snippet has been deleted')));
          }else {
              $this->response->addHeader('X-Status', rawurlencode(_t('CodeBank.PERMISSION_DENIED', '_Permission Denied')));
          }
          
          $this->redirect('admin/codeBank/');
          return $this->getResponseNegotiator()->respond($this->request);
      }
code: public function doDelete($data, Form $form) {
          $record=$this->currentPage();
      
          if($record->canDelete()) {
              Session::set('CodeBank.deletedSnippetID', $record->ID);
              $record->delete();
      
              $this->response->addHeader('X-Status', rawurlencode(_t('CodeBank.SNIPPET_DELETED', '_Snippet has been deleted')));
          }else {
              $this->response->addHeader('X-Status', rawurlencode(_t('CodeBank.PERMISSION_DENIED', '_Permission Denied')));
          }
          
          $this->redirect('admin/codeBank/');
          return $this->getResponseNegotiator()->respond($this->request);
      }
code_tokens: public function doDelete ( $ data , Form $ form ) { $ record = $ this -> currentPage ( ) ; if ( $ record -> canDelete ( ) ) { Session :: set ( 'CodeBank.deletedSnippetID' , $ record -> ID ) ; $ record -> delete ( ) ; $ this -> response -> addHeader ( 'X-Status' , rawurlencode ( _t ( 'CodeBank.SNIPPET_DELETED' , '_Snippet has been deleted' ) ) ) ; } else { $ this -> response -> addHeader ( 'X-Status' , rawurlencode ( _t ( 'CodeBank.PERMISSION_DENIED' , '_Permission Denied' ) ) ) ; } $ this -> redirect ( 'admin/codeBank/' ) ; return $ this -> getResponseNegotiator ( ) -> respond ( $ this -> request ) ; }
docstring: Deletes the snippet from the database
  @param {array} $data Data submitted by the user
  @param {Form} $form Submitting form
  @return {SS_HTTPResponse} Response
docstring_tokens: Deletes the snippet from the database