ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 @inheritDoc More...
 
 afterObjectLoad ()
 
 create ()
 
 read ()
 
 update ()
 
 delete ()
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 @description 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 ()
 @depracated 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
 @con_is_primary true @con_is_unique true @con_has_field true @con_fieldtype text @con_length 64 More...
 
string $identification = ''
 @con_has_field true @con_fieldtype text @con_length 256 More...
 
string $translation = ''
 @con_has_field true @con_fieldtype text @con_length 4000 More...
 
string $language_key = ''
 @con_has_field true @con_fieldtype text @con_length 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 ()
 @description Returns an instance of the instatiated calling active record (needs to be done in static methods) @TODO : 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.

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:26

References $DIC.

Referenced by hasDefaultTranslation().

+ Here is the caller graph for this function:

◆ getId()

ilMMItemTranslationStorage::getId ( )
Returns
string

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

147 : string
148 {
149 return $this->id;
150 }
string $id
@con_is_primary true @con_is_unique true @con_has_field true @con_fieldtype text @con_length 64

References $id.

◆ getIdentification()

ilMMItemTranslationStorage::getIdentification ( )
Returns
string

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

163 : string
164 {
166 }
string $identification
@con_has_field true @con_fieldtype text @con_length 256

References $identification.

◆ getLanguageKey()

ilMMItemTranslationStorage::getLanguageKey ( )
Returns
string

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

195 : string
196 {
197 return $this->language_key;
198 }
string $language_key
@con_has_field true @con_fieldtype text @con_length 8

References $language_key.

◆ getTranslation()

ilMMItemTranslationStorage::getTranslation ( )
Returns
string

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

179 : string
180 {
181 return $this->translation;
182 }
string $translation
@con_has_field true @con_fieldtype text @con_length 4000

References $translation.

◆ hasDefaultTranslation()

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

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

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

References $lng, and getDefaultLanguage().

+ Here is the call graph for this function:

◆ setId()

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

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

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

References $id.

◆ setIdentification()

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

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

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

References $identification.

◆ setLanguageKey()

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

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

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

References $language_key.

◆ setTranslation()

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

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

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

References $translation.

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

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

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) {
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.

References $identification, $language_key, and $translation.

Referenced by storeDefaultTranslation().

+ 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

@con_is_primary true @con_is_unique true @con_has_field true @con_fieldtype text @con_length 64

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

Referenced by getId(), and setId().

◆ $identification

string ilMMItemTranslationStorage::$identification = ''
protected

@con_has_field true @con_fieldtype text @con_length 256

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

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

◆ $language_key

string ilMMItemTranslationStorage::$language_key = ''
protected

@con_has_field true @con_fieldtype text @con_length 8

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

Referenced by getLanguageKey(), setLanguageKey(), and storeTranslation().

◆ $translation

string ilMMItemTranslationStorage::$translation = ''
protected

@con_has_field true @con_fieldtype text @con_length 4000

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

Referenced by getTranslation(), setTranslation(), storeDefaultTranslation(), and storeTranslation().


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