Code Duplication    Length = 4-8 lines in 3 locations

src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php 1 location

@@ 1175-1178 (lines=4) @@
1172
                    WHERE c_id = '.$courseId.' AND (session_id = 0 OR session_id IS NULL)';
1173
        }
1174
1175
        if (!empty($id_list)) {
1176
            $id_list = array_map('intval', $id_list);
1177
            $sql .= " AND id IN (".implode(', ', $id_list).") ";
1178
        }
1179
1180
        $db_result = Database::query($sql);
1181
        if ($db_result) {

main/inc/lib/course.lib.php 1 location

@@ 1514-1518 (lines=5) @@
1511
            }
1512
        }
1513
1514
        if (!empty($userIdList)) {
1515
            $userIdList = array_map('intval', $userIdList);
1516
            $userIdList = implode('","', $userIdList);
1517
            $sql .= ' AND user.id IN ("'.$userIdList.'")';
1518
        }
1519
1520
        if (isset($filterByActive)) {
1521
            $filterByActive = intval($filterByActive);

main/work/work.lib.php 1 location

@@ 465-472 (lines=8) @@
462
    $groupId = intval($groupId);
463
    $studentCondition = null;
464
465
    if (!empty($onlyUserList)) {
466
        $onlyUserList = array_map('intval', $onlyUserList);
467
        $studentCondition = "AND u.user_id IN ('".implode("', '", $onlyUserList)."') ";
468
    } else {
469
        if (empty($userId)) {
470
            return 0;
471
        }
472
    }
473
474
    $groupIid = 0;
475
    if ($groupId) {