original_string: public function resubmit_request() : data_request {
          if ($this->is_active()) {
              $this->set('status', api::DATAREQUEST_STATUS_REJECTED)->save();
          }
  
          if (!$this->is_resettable()) {
              throw new \moodle_exception('cannotreset', 'tool_dataprivacy');
          }
  
          $currentdata = $this->to_record();
          unset($currentdata->id);
  
          // Clone the original request, but do not notify.
          $clone = api::create_data_request(
                  $this->get('userid'),
                  $this->get('type'),
                  $this->get('comments'),
                  $this->get('creationmethod'),
                  false
              );
          $clone->set('comments', $this->get('comments'));
          $clone->set('dpo', $this->get('dpo'));
          $clone->set('requestedby', $this->get('requestedby'));
          $clone->save();
  
          return $clone;
      }
code: public function resubmit_request() : data_request {
          if ($this->is_active()) {
              $this->set('status', api::DATAREQUEST_STATUS_REJECTED)->save();
          }
  
          if (!$this->is_resettable()) {
              throw new \moodle_exception('cannotreset', 'tool_dataprivacy');
          }
  
          $currentdata = $this->to_record();
          unset($currentdata->id);
  
          // Clone the original request, but do not notify.
          $clone = api::create_data_request(
                  $this->get('userid'),
                  $this->get('type'),
                  $this->get('comments'),
                  $this->get('creationmethod'),
                  false
              );
          $clone->set('comments', $this->get('comments'));
          $clone->set('dpo', $this->get('dpo'));
          $clone->set('requestedby', $this->get('requestedby'));
          $clone->save();
  
          return $clone;
      }
code_tokens: public function resubmit_request ( ) : data_request { if ( $ this -> is_active ( ) ) { $ this -> set ( 'status' , api :: DATAREQUEST_STATUS_REJECTED ) -> save ( ) ; } if ( ! $ this -> is_resettable ( ) ) { throw new \ moodle_exception ( 'cannotreset' , 'tool_dataprivacy' ) ; } $ currentdata = $ this -> to_record ( ) ; unset ( $ currentdata -> id ) ; // Clone the original request, but do not notify. $ clone = api :: create_data_request ( $ this -> get ( 'userid' ) , $ this -> get ( 'type' ) , $ this -> get ( 'comments' ) , $ this -> get ( 'creationmethod' ) , false ) ; $ clone -> set ( 'comments' , $ this -> get ( 'comments' ) ) ; $ clone -> set ( 'dpo' , $ this -> get ( 'dpo' ) ) ; $ clone -> set ( 'requestedby' , $ this -> get ( 'requestedby' ) ) ; $ clone -> save ( ) ; return $ clone ; }
docstring: Reject this request and resubmit it as a fresh request.
  
  Note: This does not check whether any other completed requests exist for this user.
  
  @return  self
docstring_tokens: Reject this request and resubmit it as a fresh request .