ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
- Public Member Functions inherited from CachedActiveRecord
 getCache ()
 
 getCacheIdentifier ()
 
 getTTL ()
 
 __construct ($primary_key=0, arConnector $connector=null)
 
 afterObjectLoad ()
 
 storeObjectToCache ()
 
 buildFromArray (array $array)
 
 store ()
 
 save ()
 
 create ()
 
 copy ($new_id=0)
 
 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())
 
static connector (arConnector $connector)
 
- 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 ( )

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

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.

References $DIC.

Referenced by ilMMItemInformation\__construct().

94  : string
95  {
96  static $default_language;
97  global $DIC;
98  if (!$default_language) {
99  $default_language = $DIC->language()->getDefaultLanguage() ? $DIC->language()->getDefaultLanguage() : "en";
100  }
101 
102  return $default_language;
103  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ getId()

ilMMItemTranslationStorage::getId ( )
Returns
string

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

References $id.

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

◆ getIdentification()

ilMMItemTranslationStorage::getIdentification ( )
Returns
string

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

References $identification.

167  : string
168  {
169  return $this->identification;
170  }

◆ getLanguageKey()

ilMMItemTranslationStorage::getLanguageKey ( )
Returns
string

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

References $language_key.

203  : string
204  {
205  return $this->language_key;
206  }

◆ getTranslation()

ilMMItemTranslationStorage::getTranslation ( )
Returns
string

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

References $translation.

185  : string
186  {
187  return $this->translation;
188  }

◆ hasDefaultTranslation()

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

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

References $key, and $lng.

82  : bool
83  {
84  $lng = self::getDefaultLanguage();
85  $key = "{$identification->serialize()}|{$lng}";
86 
87  return self::find($key) instanceof self;
88  }
$lng
$key
Definition: croninfo.php:18

◆ setId()

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

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

References $id.

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

◆ setIdentification()

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

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

References $identification.

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

◆ setLanguageKey()

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

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

References $language_key.

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

◆ setTranslation()

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

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

References $translation.

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

◆ 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.

References $identification, $key, and $lng.

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

48  : self
49  {
50  return self::storeTranslation($identification, self::getDefaultLanguage(), $translation);
51  }
+ 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.

References CachedActiveRecord\find().

Referenced by ilMMItemTranslationGUI\saveLanguages().

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) {
28  $mt = new 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  }
static find($primary_key, array $add_constructor_args=array())
Class ilMMItemTranslationStorage.
+ 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

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

Referenced by getLanguageKey(), and setLanguageKey().

◆ $translation

ilMMItemTranslationStorage::$translation = ''
protected

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

Referenced by getTranslation(), and setTranslation().


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