22 if ($translation ===
"-") {
25 $language_identification =
"{$identification->serialize()}|$language_key";
28 $mt =
new ilMMItemTranslationStorage();
29 $mt->setId($language_identification);
30 $mt->setIdentification($identification->serialize());
34 $mt->setTranslation($translation);
35 $mt->setLanguageKey($language_key);
50 return self::storeTranslation($identification, self::getDefaultLanguage(), $translation);
61 if (!self::hasDefaultTranslation($identification)) {
64 $lng = self::getDefaultLanguage();
65 $key =
"{$identification->serialize()}|{$lng}";
69 if ($item = self::find(
$key)) {
70 return $item->getTranslation();
84 $lng = self::getDefaultLanguage();
85 $key =
"{$identification->serialize()}|{$lng}";
87 return self::find(
$key) instanceof
self;
96 static $default_language;
98 if (!$default_language) {
99 $default_language = $DIC->language()->getDefaultLanguage() ? $DIC->language()->getDefaultLanguage() :
"en";
102 return $default_language;
setIdentification(string $identification)
static getDefaultLanguage()
$connector_container_name
static find($primary_key, array $add_constructor_args=array())
Class CachedActiveRecord.
Interface IdentificationInterface.
static getInstance($component)
static storeDefaultTranslation(IdentificationInterface $identification, string $translation)
setTranslation(string $translation)
static hasDefaultTranslation(IdentificationInterface $identification)
setLanguageKey(string $language_key)
static storeTranslation(IdentificationInterface $identification, string $language_key, string $translation)
Class ilMMItemTranslationStorage.