original_string: protected function process_lesson_override($data) {
          global $DB;
  
          $data = (object)$data;
          $oldid = $data->id;
  
          // Based on userinfo, we'll restore user overides or no.
          $userinfo = $this->get_setting_value('userinfo');
  
          // Skip user overrides if we are not restoring userinfo.
          if (!$userinfo && !is_null($data->userid)) {
              return;
          }
  
          $data->lessonid = $this->get_new_parentid('lesson');
  
          if (!is_null($data->userid)) {
              $data->userid = $this->get_mappingid('user', $data->userid);
          }
          if (!is_null($data->groupid)) {
              $data->groupid = $this->get_mappingid('group', $data->groupid);
          }
  
          $data->available = $this->apply_date_offset($data->available);
          $data->deadline = $this->apply_date_offset($data->deadline);
  
          $newitemid = $DB->insert_record('lesson_overrides', $data);
  
          // Add mapping, restore of logs needs it.
          $this->set_mapping('lesson_override', $oldid, $newitemid);
      }
code: protected function process_lesson_override($data) {
          global $DB;
  
          $data = (object)$data;
          $oldid = $data->id;
  
          // Based on userinfo, we'll restore user overides or no.
          $userinfo = $this->get_setting_value('userinfo');
  
          // Skip user overrides if we are not restoring userinfo.
          if (!$userinfo && !is_null($data->userid)) {
              return;
          }
  
          $data->lessonid = $this->get_new_parentid('lesson');
  
          if (!is_null($data->userid)) {
              $data->userid = $this->get_mappingid('user', $data->userid);
          }
          if (!is_null($data->groupid)) {
              $data->groupid = $this->get_mappingid('group', $data->groupid);
          }
  
          $data->available = $this->apply_date_offset($data->available);
          $data->deadline = $this->apply_date_offset($data->deadline);
  
          $newitemid = $DB->insert_record('lesson_overrides', $data);
  
          // Add mapping, restore of logs needs it.
          $this->set_mapping('lesson_override', $oldid, $newitemid);
      }
code_tokens: protected function process_lesson_override ( $ data ) { global $ DB ; $ data = ( object ) $ data ; $ oldid = $ data -> id ; // Based on userinfo, we'll restore user overides or no. $ userinfo = $ this -> get_setting_value ( 'userinfo' ) ; // Skip user overrides if we are not restoring userinfo. if ( ! $ userinfo && ! is_null ( $ data -> userid ) ) { return ; } $ data -> lessonid = $ this -> get_new_parentid ( 'lesson' ) ; if ( ! is_null ( $ data -> userid ) ) { $ data -> userid = $ this -> get_mappingid ( 'user' , $ data -> userid ) ; } if ( ! is_null ( $ data -> groupid ) ) { $ data -> groupid = $ this -> get_mappingid ( 'group' , $ data -> groupid ) ; } $ data -> available = $ this -> apply_date_offset ( $ data -> available ) ; $ data -> deadline = $ this -> apply_date_offset ( $ data -> deadline ) ; $ newitemid = $ DB -> insert_record ( 'lesson_overrides' , $ data ) ; // Add mapping, restore of logs needs it. $ this -> set_mapping ( 'lesson_override' , $ oldid , $ newitemid ) ; }
docstring: Process a lesson override restore
  @param object $data The data in object form
  @return void
docstring_tokens: Process a lesson override restore