ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 
- Public Member Functions inherited from CachedActiveRecord
 getCacheIdentifier ()
 
 getTTL ()
 
 __construct (mixed $primary_key=0, ?arConnector $arConnector=null)
 
 afterObjectLoad ()
 
 create ()
 
 read ()
 
 update ()
 
 delete ()
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 Return the Name of your Connector Table More...
 
 setConnectorContainerName (string $connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct (mixed $primary_key=0)
 
 storeObjectToCache ()
 
 asStdClass ()
 
 asArray ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, string $value)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy (int $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 ActiveRecord
static returnDbTableName ()
 
static installDB ()
 
static renameDBField (string $old_name, string $new_name)
 
static tableExists ()
 
static fieldExists (string $field_name)
 
static removeDBField (string $field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 never use in ILIAS Core, Plugins only More...
 
static preloadObjects ()
 
static additionalParams (array $additional_params)
 
static findOrFail ($primary_key, array $add_constructor_args=[])
 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=[])
 
static where ($where, $operator=null)
 
static innerjoinAR (ActiveRecord $activeRecord, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
static innerjoin (string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
static leftjoin (string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
static orderBy (string $orderBy, string $orderDirection='ASC')
 
static dateFormat (string $date_format='d.m.Y - H:i:s')
 
static limit (int $start, int $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $arConnector)
 
static raw (bool $set_raw=true)
 
static getArray (?string $key=null, string|array|null $values=null)
 
static _toCamelCase (string $str, bool $capitalise_first_char=false)
 

Protected Attributes

string $id = null
 true true true text 64 More...
 
string $identification = ''
 true text 256 More...
 
string $translation = ''
 true text 4000 More...
 
string $language_key = ''
 true text 8 More...
 
string $connector_container_name = "il_mm_translation"
 
- Protected Attributes inherited from ActiveRecord
bool $ar_safe_read = true
 
string $connector_container_name = ''
 
bool $is_new = true
 

Additional Inherited Members

- Protected Member Functions inherited from ActiveRecord
 installDatabase ()
 
- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 Returns an instance of the instatiated calling active record (needs to be done in static methods) : This should be cached somehow More...
 
static fromCamelCase (string $str)
 

Detailed Description

Member Function Documentation

◆ getDefaultLanguage()

static ilMMItemTranslationStorage::getDefaultLanguage ( )
static
Returns
string

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

References $DIC.

Referenced by ilMMItemInformation\__construct().

102  : string
103  {
104  static $default_language;
105  global $DIC;
106  if (!isset($default_language)) {
107  $default_language = $DIC->language()->getDefaultLanguage() ?: "en";
108  }
109 
110  return $default_language;
111  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ getId()

ilMMItemTranslationStorage::getId ( )
Returns
string

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

References $id.

147  : string
148  {
149  return $this->id;
150  }

◆ getIdentification()

ilMMItemTranslationStorage::getIdentification ( )
Returns
string

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

References $identification.

163  : string
164  {
165  return $this->identification;
166  }

◆ getLanguageKey()

ilMMItemTranslationStorage::getLanguageKey ( )
Returns
string

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

References $language_key.

195  : string
196  {
197  return $this->language_key;
198  }

◆ getTranslation()

ilMMItemTranslationStorage::getTranslation ( )
Returns
string

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

References $translation.

179  : string
180  {
181  return $this->translation;
182  }

◆ hasDefaultTranslation()

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

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

References $lng.

91  : bool
92  {
93  $lng = self::getDefaultLanguage();
94  $key = "{$identification->serialize()}|$lng";
95 
96  return self::find($key) instanceof self;
97  }
global $lng
Definition: privfeed.php:31

◆ setId()

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

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

References $id.

155  : void
156  {
157  $this->id = $id;
158  }

◆ setIdentification()

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

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

References $identification.

171  : void
172  {
173  $this->identification = $identification;
174  }

◆ setLanguageKey()

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

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

References $language_key.

203  : void
204  {
205  $this->language_key = $language_key;
206  }

◆ setTranslation()

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

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

References $translation.

187  : void
188  {
189  $this->translation = $translation;
190  }

◆ storeDefaultTranslation()

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

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

References $identification, $lng, and null.

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

61  : self
62  {
63  return self::storeTranslation($identification, self::getDefaultLanguage(), $translation);
64  }
+ 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 35 of file class.ilMMItemTranslationStorage.php.

Referenced by ilMMItemTranslationGUI\saveLanguages().

35  : self
36  {
37  if ($translation === "-") {
38  return new self();
39  }
40  $language_identification = "{$identification->serialize()}|$language_key";
41  $mt = ilMMItemTranslationStorage::find($language_identification);
42  if (!$mt instanceof ilMMItemTranslationStorage) {
43  $mt = new ilMMItemTranslationStorage();
44  $mt->setId($language_identification);
45  $mt->setIdentification($identification->serialize());
46  $mt->create();
47  }
48 
49  $mt->setTranslation($translation);
50  $mt->setLanguageKey($language_key);
51  $mt->update();
52 
53  return $mt;
54  }
Class ilMMItemTranslationStorage.
+ Here is the caller graph for this function:

Field Documentation

◆ $connector_container_name

string ilMMItemTranslationStorage::$connector_container_name = "il_mm_translation"
protected

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

◆ $id

string ilMMItemTranslationStorage::$id = null
protected

true true true text 64

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

Referenced by getId(), and setId().

◆ $identification

string ilMMItemTranslationStorage::$identification = ''
protected

true text 256

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

Referenced by getIdentification(), setIdentification(), and storeDefaultTranslation().

◆ $language_key

string ilMMItemTranslationStorage::$language_key = ''
protected

true text 8

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

Referenced by getLanguageKey(), and setLanguageKey().

◆ $translation

string ilMMItemTranslationStorage::$translation = ''
protected

true text 4000

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

Referenced by getTranslation(), and setTranslation().


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