Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 2354-2363 (lines=10) @@
2351
     * @param	string	Field value
2352
     * @return	boolean	true if field updated, false otherwise
2353
     */
2354
    public static function update_session_extra_field_value($sessionId, $variable, $value = '')
2355
    {
2356
        $extraFieldValue = new ExtraFieldValue('session');
2357
        $params = [
2358
            'item_id' => $sessionId,
2359
            'variable' => $variable,
2360
            'value' => $value,
2361
        ];
2362
        $extraFieldValue->save($params);
2363
    }
2364
2365
    /**
2366
     * Checks the relationship between a session and a course.

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

@@ 1825-1834 (lines=10) @@
1822
     *
1823
     * @return    boolean    true if field updated, false otherwise
1824
     */
1825
    public static function update_extra_field_value($userId, $variable, $value = '')
1826
    {
1827
        $extraFieldValue = new ExtraFieldValue('user');
1828
        $params = [
1829
            'item_id' => $userId,
1830
            'variable' => $variable,
1831
            'value' => $value
1832
        ];
1833
        return $extraFieldValue->save($params);
1834
    }
1835
1836
    /**
1837
     * Get an array of extra fields with field details (type, default value and options)