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

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