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

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

main/work/work.lib.php 1 location

@@ 3828-3836 (lines=9) @@
3825
 * @param $workId
3826
 * @return mixed
3827
 */
3828
function checkExistingWorkFileName($filename, $workId)
3829
{
3830
    $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
3831
    $filename = Database::escape_string($filename);
3832
    $sql = "SELECT title FROM $work_table
3833
            WHERE parent_id = $workId AND title = '$filename' AND active = 1";
3834
    $result = Database::query($sql);
3835
    return Database::fetch_assoc($result);
3836
}
3837
3838
/**
3839
 * @param array $workInfo