original_string: public function process_course_completion_aggr_methd($data) {
          global $DB;
  
          $data = (object)$data;
  
          $data->course = $this->get_courseid();
  
          // Only create the course_completion_aggr_methd records if
          // the target course has not them defined. MDL-28180
          if (!$DB->record_exists('course_completion_aggr_methd', array(
                      'course' => $data->course,
                      'criteriatype' => $data->criteriatype))) {
              $params = array(
                  'course' => $data->course,
                  'criteriatype' => $data->criteriatype,
                  'method' => $data->method,
                  'value' => $data->value,
              );
              $DB->insert_record('course_completion_aggr_methd', $params);
          }
      }
code: public function process_course_completion_aggr_methd($data) {
          global $DB;
  
          $data = (object)$data;
  
          $data->course = $this->get_courseid();
  
          // Only create the course_completion_aggr_methd records if
          // the target course has not them defined. MDL-28180
          if (!$DB->record_exists('course_completion_aggr_methd', array(
                      'course' => $data->course,
                      'criteriatype' => $data->criteriatype))) {
              $params = array(
                  'course' => $data->course,
                  'criteriatype' => $data->criteriatype,
                  'method' => $data->method,
                  'value' => $data->value,
              );
              $DB->insert_record('course_completion_aggr_methd', $params);
          }
      }
code_tokens: public function process_course_completion_aggr_methd ( $ data ) { global $ DB ; $ data = ( object ) $ data ; $ data -> course = $ this -> get_courseid ( ) ; // Only create the course_completion_aggr_methd records if // the target course has not them defined. MDL-28180 if ( ! $ DB -> record_exists ( 'course_completion_aggr_methd' , array ( 'course' => $ data -> course , 'criteriatype' => $ data -> criteriatype ) ) ) { $ params = array ( 'course' => $ data -> course , 'criteriatype' => $ data -> criteriatype , 'method' => $ data -> method , 'value' => $ data -> value , ) ; $ DB -> insert_record ( 'course_completion_aggr_methd' , $ params ) ; } }
docstring: Process course completion aggregate methods
  
  @global moodle_database $DB
  @param stdClass $data
docstring_tokens: Process course completion aggregate methods