Code Duplication    Length = 7-7 lines in 2 locations

src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php 2 locations

@@ 2714-2720 (lines=7) @@
2711
                    }
2712
2713
                    // Updating prerequisites
2714
                    foreach ($old_prerequisite as $key => $my_old_prerequisite) {
2715
                        if ($my_old_prerequisite != '') {
2716
                            $sql = "UPDATE ".$table_item." SET prerequisite = '".$my_old_prerequisite."'
2717
                                    WHERE c_id = " . $this->destination_course_id." AND id = '".$key."'  ";
2718
                            Database::query($sql);
2719
                        }
2720
                    }
2721
2722
                    // Updating refs
2723
                    foreach ($old_refs as $key => $my_old_ref) {
@@ 2723-2729 (lines=7) @@
2720
                    }
2721
2722
                    // Updating refs
2723
                    foreach ($old_refs as $key => $my_old_ref) {
2724
                        if ($my_old_ref != '') {
2725
                            $sql = "UPDATE ".$table_item." SET ref = '".$my_old_ref."'
2726
                                    WHERE c_id = " . $this->destination_course_id." AND id = '".$key."'  ";
2727
                            Database::query($sql);
2728
                        }
2729
                    }
2730
2731
                    foreach ($parent_item_ids as $new_item_id => $parent_item_old_id) {
2732
                        $parent_new_id = 0;