Code Duplication    Length = 13-16 lines in 2 locations

main/gradebook/lib/be/forumthreadlink.class.php 1 location

@@ 372-384 (lines=13) @@
369
		}
370
	}
371
372
	function delete_linked_data()
373
	{
374
		$ref_id = $this->get_ref_id();
375
		if (!empty($ref_id)) {
376
			//Cleans forum
377
			$sql = 'UPDATE '.$this->get_forum_thread_table().' SET
378
			        thread_qualify_max = 0,
379
			        thread_weight = 0,
380
			        thread_title_qualify = ""
381
                    WHERE c_id = '.$this->course_id.' AND thread_id= '.$ref_id;
382
			Database::query($sql);
383
		}
384
	}
385
}
386

main/gradebook/lib/be/studentpublicationlink.class.php 1 location

@@ 430-445 (lines=16) @@
427
		}
428
	}
429
430
	public function delete_linked_data()
431
	{
432
        $data = $this->get_exercise_data();
433
434
        if (empty($data)) {
435
            return '';
436
        }
437
438
        if (!empty($id)) {
439
			//Cleans works
440
            $sql = 'UPDATE '.$this->get_studpub_table().' 
441
                    SET weight=0
442
                    WHERE c_id = '.$this->course_id.' AND id ='.$id;
443
			Database::query($sql);
444
		}
445
	}
446
}
447