Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 2041-2050 (lines=10) @@
2038
     *
2039
     * @return    boolean    true if field updated, false otherwise
2040
     */
2041
    public static function update_extra_field_value($userId, $variable, $value = '')
2042
    {
2043
        $extraFieldValue = new ExtraFieldValue('user');
2044
        $params = [
2045
            'item_id' => $userId,
2046
            'variable' => $variable,
2047
            'value' => $value
2048
        ];
2049
2050
        return $extraFieldValue->save($params);
2051
    }
2052
2053
    /**

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

@@ 2449-2458 (lines=10) @@
2446
     * @param	string	Field value
2447
     * @return	boolean	true if field updated, false otherwise
2448
     */
2449
    public static function update_session_extra_field_value($sessionId, $variable, $value = '')
2450
    {
2451
        $extraFieldValue = new ExtraFieldValue('session');
2452
        $params = [
2453
            'item_id' => $sessionId,
2454
            'variable' => $variable,
2455
            'value' => $value,
2456
        ];
2457
        return $extraFieldValue->save($params);
2458
    }
2459
2460
    /**
2461
     * Checks the relationship between a session and a course.