Code Duplication    Length = 9-12 lines in 3 locations

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

@@ 784-795 (lines=12) @@
781
     * @param int $task_id
782
     * @return void
783
     */
784
    public static function deleteTask($blog_id, $task_id)
785
    {
786
        $tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
787
        $course_id = api_get_course_int_id();
788
        $blog_id = intval($blog_id);
789
        $task_id = intval($task_id);
790
791
        // Delete posts
792
        $sql = "DELETE FROM $tbl_blogs_tasks
793
                WHERE c_id = $course_id AND blog_id = $blog_id AND task_id = $task_id";
794
        Database::query($sql);
795
    }
796
797
    /**
798
     * Deletes an assigned task from a blog

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

@@ 1491-1502 (lines=12) @@
1488
     * @param int $editIcon
1489
     * @return array
1490
     */
1491
    public static function getTool($editIcon)
1492
    {
1493
        $course_tool_table = Database::get_course_table(TABLE_TOOL_LIST);
1494
        $editIcon = intval($editIcon);
1495
1496
        $sql = "SELECT * FROM $course_tool_table
1497
                WHERE iid = $editIcon";
1498
        $result = Database::query($sql);
1499
        $tool = Database::fetch_assoc($result, 'ASSOC');
1500
1501
        return $tool;
1502
    }
1503
1504
    /**
1505
     * @return string

main/work/work.lib.php 1 location

@@ 3780-3788 (lines=9) @@
3777
 * @param $workId
3778
 * @return mixed
3779
 */
3780
function checkExistingWorkFileName($filename, $workId)
3781
{
3782
    $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
3783
    $filename = Database::escape_string($filename);
3784
    $sql = "SELECT title FROM $work_table
3785
            WHERE parent_id = $workId AND title = '$filename' AND active = 1";
3786
    $result = Database::query($sql);
3787
    return Database::fetch_assoc($result);
3788
}
3789
3790
/**
3791
 * @param array $workInfo