Code Duplication    Length = 14-14 lines in 2 locations

main/lp/learnpath.class.php 2 locations

@@ 11143-11156 (lines=14) @@
11140
     * @param int $subscribeUsers (0 = false, 1 = true)
11141
     * @return bool
11142
     */
11143
    public function setSubscribeUsers($value)
11144
    {
11145
        if ($this->debug > 0) {
11146
            error_log('New LP - In learnpath::set_subscribe_users()', 0);
11147
        }
11148
        $this->subscribeUsers = intval($value); ;
11149
        $lp_table = Database::get_course_table(TABLE_LP_MAIN);
11150
        $lp_id = $this->get_id();
11151
        $sql = "UPDATE $lp_table SET subscribe_users = ".$this->subscribeUsers."
11152
                WHERE c_id = ".$this->course_int_id." AND id = $lp_id";
11153
        Database::query($sql);
11154
11155
        return true;
11156
    }
11157
11158
    /**
11159
     * Calculate the count of stars for a user in this LP
@@ 11703-11716 (lines=14) @@
11700
     * @param int $value (0 = false, 1 = true)
11701
     * @return bool Always returns true
11702
     */
11703
    public function setAccumulateScormTime($value)
11704
    {
11705
        if ($this->debug > 0) {
11706
            error_log('New LP - In learnpath::setAccumulateScormTime()', 0);
11707
        }
11708
        $this->accumulateScormTime = intval($value);
11709
        $lp_table = Database::get_course_table(TABLE_LP_MAIN);
11710
        $lp_id = $this->get_id();
11711
        $sql = "UPDATE $lp_table SET accumulate_scorm_time = ".$this->accumulateScormTime."
11712
                WHERE c_id = ".$this->course_int_id." AND id = $lp_id";
11713
        Database::query($sql);
11714
11715
        return true;
11716
    }
11717
11718
    /**
11719
     * Returns an HTML-formatted link to a resource, to incorporate directly into