original_string: private function process_delete_request($item) {
          global $DB;
  
          $gradeitem = \grade_item::fetch(array('id' => $item->id));
          if (($gbs = gradebookservices::find_ltiservice_gradebookservice_for_lineitem($item->id)) == false) {
              throw new \Exception(null, 403);
          }
          if (!$gradeitem->delete('mod/ltiservice_gradebookservices')) {
              throw new \Exception(null, 500);
          } else {
              $sqlparams = array();
              $sqlparams['id'] = $gbs->id;
              if (!$DB->delete_records('ltiservice_gradebookservices', $sqlparams)) {
                  throw new \Exception(null, 500);
              }
          }
      }
code: private function process_delete_request($item) {
          global $DB;
  
          $gradeitem = \grade_item::fetch(array('id' => $item->id));
          if (($gbs = gradebookservices::find_ltiservice_gradebookservice_for_lineitem($item->id)) == false) {
              throw new \Exception(null, 403);
          }
          if (!$gradeitem->delete('mod/ltiservice_gradebookservices')) {
              throw new \Exception(null, 500);
          } else {
              $sqlparams = array();
              $sqlparams['id'] = $gbs->id;
              if (!$DB->delete_records('ltiservice_gradebookservices', $sqlparams)) {
                  throw new \Exception(null, 500);
              }
          }
      }
code_tokens: private function process_delete_request ( $ item ) { global $ DB ; $ gradeitem = \ grade_item :: fetch ( array ( 'id' => $ item -> id ) ) ; if ( ( $ gbs = gradebookservices :: find_ltiservice_gradebookservice_for_lineitem ( $ item -> id ) ) == false ) { throw new \ Exception ( null , 403 ) ; } if ( ! $ gradeitem -> delete ( 'mod/ltiservice_gradebookservices' ) ) { throw new \ Exception ( null , 500 ) ; } else { $ sqlparams = array ( ) ; $ sqlparams [ 'id' ] = $ gbs -> id ; if ( ! $ DB -> delete_records ( 'ltiservice_gradebookservices' , $ sqlparams ) ) { throw new \ Exception ( null , 500 ) ; } } }
docstring: Process a DELETE request.
  
  @param \ltiservice_gradebookservices\local\resources\lineitem $item Grade item instance
  @throws \Exception
docstring_tokens: Process a DELETE request .