fix issue in Lang Model
This commit is contained in:
@@ -9,17 +9,14 @@ class Lang extends BaseLang {
|
||||
/**
|
||||
* Return the default language object, using a local variable to cache it.
|
||||
*
|
||||
* @throws RuntimeException
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
private static $default_lang = null;
|
||||
|
||||
public static function getDefaultLanguage() {
|
||||
|
||||
if (self::$default_lang == null) {
|
||||
$default_lang = LangQuery::create()->findOneByByDefault(true);
|
||||
|
||||
if ($default_lang == null) throw new RuntimeException("No default language is defined. Please define one.");
|
||||
}
|
||||
$default_lang = LangQuery::create()->findOneByByDefault(1);
|
||||
|
||||
if ($default_lang == null) throw new \RuntimeException("No default language is defined. Please define one.");
|
||||
|
||||
return $default_lang;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user