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

@@ 1382-1393 (lines=12) @@
1379
     * @param int $editIcon
1380
     * @return array
1381
     */
1382
    public static function getTool($editIcon)
1383
    {
1384
        $course_tool_table = Database::get_course_table(TABLE_TOOL_LIST);
1385
        $editIcon = intval($editIcon);
1386
1387
        $sql = "SELECT * FROM $course_tool_table
1388
                WHERE iid = $editIcon";
1389
        $result = Database::query($sql);
1390
        $tool = Database::fetch_assoc($result, 'ASSOC');
1391
1392
        return $tool;
1393
    }
1394
1395
    /**
1396
     * @return string

main/work/work.lib.php 1 location

@@ 3766-3774 (lines=9) @@
3763
 * @param $workId
3764
 * @return mixed
3765
 */
3766
function checkExistingWorkFileName($filename, $workId)
3767
{
3768
    $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
3769
    $filename = Database::escape_string($filename);
3770
    $sql = "SELECT title FROM $work_table
3771
            WHERE parent_id = $workId AND title = '$filename' AND active = 1";
3772
    $result = Database::query($sql);
3773
    return Database::fetch_assoc($result);
3774
}
3775
3776
/**
3777
 * @param array $workInfo