original_string: private function get_resource_link() {
          // Get activity context only for backups.
          if ($this->backuprec->type == 'activity' && $this->type == 'backup') {
              $context = context_module::instance($this->backuprec->itemid);
          } else { // Course or Section which have the same context getter.
              $context = context_course::instance($this->backuprec->itemid);
          }
  
          // Generate link based on operation type.
          if ($this->type == 'backup') {
              // For backups simply generate link to restore file area UI.
              $url = new moodle_url('/backup/restorefile.php', array('contextid' => $context->id));
          } else {
              // For restore generate link to the item itself.
              $url = $context->get_url();
          }
  
          return $url;
      }
code: private function get_resource_link() {
          // Get activity context only for backups.
          if ($this->backuprec->type == 'activity' && $this->type == 'backup') {
              $context = context_module::instance($this->backuprec->itemid);
          } else { // Course or Section which have the same context getter.
              $context = context_course::instance($this->backuprec->itemid);
          }
  
          // Generate link based on operation type.
          if ($this->type == 'backup') {
              // For backups simply generate link to restore file area UI.
              $url = new moodle_url('/backup/restorefile.php', array('contextid' => $context->id));
          } else {
              // For restore generate link to the item itself.
              $url = $context->get_url();
          }
  
          return $url;
      }
code_tokens: private function get_resource_link ( ) { // Get activity context only for backups. if ( $ this -> backuprec -> type == 'activity' && $ this -> type == 'backup' ) { $ context = context_module :: instance ( $ this -> backuprec -> itemid ) ; } else { // Course or Section which have the same context getter. $ context = context_course :: instance ( $ this -> backuprec -> itemid ) ; } // Generate link based on operation type. if ( $ this -> type == 'backup' ) { // For backups simply generate link to restore file area UI. $ url = new moodle_url ( '/backup/restorefile.php' , array ( 'contextid' => $ context -> id ) ) ; } else { // For restore generate link to the item itself. $ url = $ context -> get_url ( ) ; } return $ url ; }
docstring: Get the link to the resource that is being backuped or restored.
  
  @return moodle_url $url The link to the resource.
docstring_tokens: Get the link to the resource that is being backuped or restored .