Code Duplication    Length = 9-11 lines in 3 locations

src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php 3 locations

@@ 267-277 (lines=11) @@
264
            }
265
266
            $db_result = Database::query($sql);
267
            while ($obj = Database::fetch_object($db_result)) {
268
                $doc = new Document(
269
                    $obj->id,
270
                    $obj->path,
271
                    $obj->comment,
272
                    $obj->title,
273
                    $obj->filetype,
274
                    $obj->size
275
                );
276
                $this->course->add_resource($doc);
277
            }
278
        } else {
279
            if (!empty($this->course->type) && $this->course->type == 'partial') {
280
                $sql = "SELECT d.id, d.path, d.comment, d.title, d.filetype, d.size
@@ 309-319 (lines=11) @@
306
            }
307
308
            $db_result = Database::query($sql);
309
            while ($obj = Database::fetch_object($db_result)) {
310
                $doc = new Document(
311
                    $obj->id,
312
                    $obj->path,
313
                    $obj->comment,
314
                    $obj->title,
315
                    $obj->filetype,
316
                    $obj->size
317
                );
318
                $this->course->add_resource($doc);
319
            }
320
        }
321
    }
322
@@ 1128-1136 (lines=9) @@
1125
        }
1126
1127
        $db_result = Database::query($sql);
1128
        while ($obj = Database::fetch_object($db_result)) {
1129
            $cd = new CourseDescription(
1130
                $obj->id,
1131
                $obj->title,
1132
                $obj->content,
1133
                $obj->description_type
1134
            );
1135
            $this->course->add_resource($cd);
1136
        }
1137
    }
1138
1139
    /**