Code Duplication    Length = 8-9 lines in 2 locations

lib/Language.php 1 location

@@ 42-49 (lines=8) @@
39
        return parent::getCountGeneric ("languages", self::ALL_LANGUAGES_ID, parent::PAGE_ALL_LANGUAGES);
40
    }
41
42
    public static function getLanguageById ($languageId) {
43
        $result = parent::getDb ()->prepare('select id, lang_code  from languages where id = ?');
44
        $result->execute (array ($languageId));
45
        if ($post = $result->fetchObject ()) {
46
            return new Language ($post->id, Language::getLanguageString ($post->lang_code));
47
        }
48
        return NULL;
49
    }
50
51
52

lib/CustomColumn.php 1 location

@@ 251-259 (lines=9) @@
248
     * @param integer $customId
249
     * @return string|null
250
     */
251
    private static function getDatatypeByCustomID($customId)
252
    {
253
        $result = parent::getDb()->prepare('SELECT datatype FROM custom_columns WHERE id = ?');
254
        $result->execute(array($customId));
255
        if ($post = $result->fetchObject()) {
256
            return $post->datatype;
257
        }
258
        return NULL;
259
    }
260
261
    /**
262
     * Create a CustomColumnType by CustomID