ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMMItemTranslationStorage Class Reference

Class ilMMItemTranslationStorage. More...

+ Inheritance diagram for ilMMItemTranslationStorage:
+ Collaboration diagram for ilMMItemTranslationStorage:

Public Member Functions

 getId ()
 
 setId (string $id)
 
 getIdentification ()
 
 setIdentification (string $identification)
 
 getTranslation ()
 
 setTranslation (string $translation)
 
 getLanguageKey ()
 
 setLanguageKey (string $language_key)
 
 getCache ()
 @inheritDoc More...
 
- Public Member Functions inherited from CachedActiveRecord
 getCache ()
 
 getCacheIdentifier ()
 
 getTTL ()
 
 __construct ($primary_key=0, arConnector $connector=null)
 @inheritDoc More...
 
 afterObjectLoad ()
 
 storeObjectToCache ()
 
 buildFromArray (array $array)
 @inheritDoc More...
 
 store ()
 
 save ()
 
 create ()
 
 copy ($new_id=0)
 @inheritDoc More...
 
 read ()
 
 update ()
 
 delete ()
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 
 setConnectorContainerName ($connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct ($primary_key=0, arConnector $connector=null)
 
 storeObjectToCache ()
 
 __getConvertedDateFieldsAsArray ($format=null)
 
 __asCsv ($separator=';', $header=false)
 
 __asArray ()
 
 __asStdClass ()
 
 __asSerializedObject ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, $value)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForDb ()
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy ($new_id=0)
 
 afterObjectLoad ()
 
 read ()
 
 update ()
 
 delete ()
 
 __call ($name, $arguments)
 

Static Public Member Functions

static storeTranslation (IdentificationInterface $identification, string $language_key, string $translation)
 
static storeDefaultTranslation (IdentificationInterface $identification, string $translation)
 
static hasDefaultTranslation (IdentificationInterface $identification)
 
static getDefaultLanguage ()
 
- Static Public Member Functions inherited from CachedActiveRecord
static find ($primary_key, array $add_constructor_args=array())
 @inheritDoc More...
 
static connector (arConnector $connector)
 @inheritDoc More...
 
- Static Public Member Functions inherited from ActiveRecord
static returnDbTableName ()
 
static installDB ()
 
static renameDBField ($old_name, $new_name)
 
static tableExists ()
 
static fieldExists ($field_name)
 
static removeDBField ($field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 
static preloadObjects ()
 
static additionalParams (array $additional_params)
 
static findOrFail ($primary_key, array $add_constructor_args=array())
 Tries to find the object and throws an Exception if object is not found, instead of returning null. More...
 
static findOrGetInstance ($primary_key, array $add_constructor_args=array())
 
static where ($where, $operator=null)
 
static innerjoinAR (ActiveRecord $ar, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static innerjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static leftjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static orderBy ($orderBy, $orderDirection='ASC')
 
static dateFormat ($date_format='d.m.Y - H:i:s')
 
static limit ($start, $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $connector)
 
static raw ($set_raw=true)
 
static getArray ($key=null, $values=null)
 
static _toCamelCase ($str, $capitalise_first_char=false)
 

Protected Attributes

 $id
 
 $identification
 
 $translation = ''
 
 $language_key = ''
 
 $connector_container_name = "il_mm_translation"
 
- Protected Attributes inherited from ActiveRecord
 $ar_safe_read = true
 
 $connector_container_name = ''
 

Additional Inherited Members

- Data Fields inherited from ActiveRecord
const ACTIVE_RECORD_VERSION = '2.0.7'
 
- Protected Member Functions inherited from ActiveRecord
 serializeToCSV ($field)
 This method is called for every field of your instance if you use __asCsv. More...
 
 installDatabase ()
 
- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 
static fromCamelCase ($str)
 

Detailed Description

Member Function Documentation

◆ getCache()

ilMMItemTranslationStorage::getCache ( )

@inheritDoc

Reimplemented from CachedActiveRecord.

Definition at line 221 of file class.ilMMItemTranslationStorage.php.

222 {
224 }
Class ilGlobalCache.
static getInstance($component)

References ilGlobalCache\COMP_GLOBAL_SCREEN, and ilGlobalCache\getInstance().

+ Here is the call graph for this function:

◆ getDefaultLanguage()

static ilMMItemTranslationStorage::getDefaultLanguage ( )
static
Returns
string

Definition at line 94 of file class.ilMMItemTranslationStorage.php.

94 : string
95 {
96 static $default_language;
97 global $DIC;
98 if (!isset($default_language)) {
99 $default_language = $DIC->language()->getDefaultLanguage() ? $DIC->language()->getDefaultLanguage() : "en";
100 }
101
102 return $default_language;
103 }
global $DIC
Definition: goto.php:24

References $DIC.

Referenced by hasDefaultTranslation().

+ Here is the caller graph for this function:

◆ getId()

ilMMItemTranslationStorage::getId ( )
Returns
string

Definition at line 149 of file class.ilMMItemTranslationStorage.php.

149 : string
150 {
151 return $this->id;
152 }

References $id.

◆ getIdentification()

ilMMItemTranslationStorage::getIdentification ( )
Returns
string

Definition at line 167 of file class.ilMMItemTranslationStorage.php.

References $identification.

◆ getLanguageKey()

ilMMItemTranslationStorage::getLanguageKey ( )
Returns
string

Definition at line 203 of file class.ilMMItemTranslationStorage.php.

References $language_key.

◆ getTranslation()

ilMMItemTranslationStorage::getTranslation ( )
Returns
string

Definition at line 185 of file class.ilMMItemTranslationStorage.php.

References $translation.

◆ hasDefaultTranslation()

static ilMMItemTranslationStorage::hasDefaultTranslation ( IdentificationInterface  $identification)
static
Parameters
IdentificationInterface$identification
Returns
bool

Definition at line 82 of file class.ilMMItemTranslationStorage.php.

82 : bool
83 {
85 $key = "{$identification->serialize()}|{$lng}";
86
87 return self::find($key) instanceof self;
88 }
static find($primary_key, array $add_constructor_args=array())
@inheritDoc
$lng

References $lng, CachedActiveRecord\find(), and getDefaultLanguage().

+ Here is the call graph for this function:

◆ setId()

ilMMItemTranslationStorage::setId ( string  $id)
Parameters
string$id

Definition at line 158 of file class.ilMMItemTranslationStorage.php.

159 {
160 $this->id = $id;
161 }

References $id.

◆ setIdentification()

ilMMItemTranslationStorage::setIdentification ( string  $identification)
Parameters
string$identification

Definition at line 176 of file class.ilMMItemTranslationStorage.php.

177 {
178 $this->identification = $identification;
179 }

References $identification.

◆ setLanguageKey()

ilMMItemTranslationStorage::setLanguageKey ( string  $language_key)
Parameters
string$language_key

Definition at line 212 of file class.ilMMItemTranslationStorage.php.

213 {
214 $this->language_key = $language_key;
215 }

References $language_key.

◆ setTranslation()

ilMMItemTranslationStorage::setTranslation ( string  $translation)
Parameters
string$translation

Definition at line 194 of file class.ilMMItemTranslationStorage.php.

195 {
196 $this->translation = $translation;
197 }

References $translation.

◆ storeDefaultTranslation()

static ilMMItemTranslationStorage::storeDefaultTranslation ( IdentificationInterface  $identification,
string  $translation 
)
static
Parameters
IdentificationInterface$identification
string$translation
Returns
ilMMItemTranslationStorage

Definition at line 48 of file class.ilMMItemTranslationStorage.php.

48 : self
49 {
50 return self::storeTranslation($identification, self::getDefaultLanguage(), $translation);
51 }
static storeTranslation(IdentificationInterface $identification, string $language_key, string $translation)

References $identification, $translation, and storeTranslation().

Referenced by ilMMAbstractItemFacade\create(), and ilMMAbstractItemFacade\update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeTranslation()

static ilMMItemTranslationStorage::storeTranslation ( IdentificationInterface  $identification,
string  $language_key,
string  $translation 
)
static
Parameters
IdentificationInterface$identification
string$language_key
string$translation
Returns
ilMMItemTranslationStorage

Definition at line 20 of file class.ilMMItemTranslationStorage.php.

20 : self
21 {
22 if ($translation === "-") {
23 return new self();
24 }
25 $language_identification = "{$identification->serialize()}|$language_key";
26 $mt = ilMMItemTranslationStorage::find($language_identification);
27 if (!$mt instanceof ilMMItemTranslationStorage) {
29 $mt->setId($language_identification);
30 $mt->setIdentification($identification->serialize());
31 $mt->create();
32 }
33
34 $mt->setTranslation($translation);
35 $mt->setLanguageKey($language_key);
36 $mt->update();
37
38 return $mt;
39 }
Class ilMMItemTranslationStorage.

References $identification, $language_key, $translation, and CachedActiveRecord\find().

Referenced by ilMMItemTranslationGUI\saveLanguages(), and storeDefaultTranslation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $connector_container_name

ilMMItemTranslationStorage::$connector_container_name = "il_mm_translation"
protected

Definition at line 143 of file class.ilMMItemTranslationStorage.php.

◆ $id

ilMMItemTranslationStorage::$id
protected

Definition at line 115 of file class.ilMMItemTranslationStorage.php.

Referenced by getId(), and setId().

◆ $identification

ilMMItemTranslationStorage::$identification
protected

◆ $language_key

ilMMItemTranslationStorage::$language_key = ''
protected

◆ $translation

ilMMItemTranslationStorage::$translation = ''
protected

The documentation for this class was generated from the following file: