ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMD5295Language Class Reference
+ Inheritance diagram for ilMD5295Language:
+ Collaboration diagram for ilMD5295Language:

Public Member Functions

 setLanguage (&$lng_obj)
 
getLanguage ()
 
 getLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
- Public Member Functions inherited from ilMD5295Base
 __construct ( $a_rbac_id=0, $a_obj_id=0, $a_type=0)
 
 setRBACId ($a_id)
 
 getRBACId ()
 
 setObjId ($a_id)
 
 getObjId ()
 
 setObjType ($a_type)
 
 getObjType ()
 
 setMetaId ($a_meta_id, $a_read_data=true)
 
 getMetaId ()
 
 setParentType ($a_parent_type)
 
 getParentType ()
 
 setParentId ($a_id)
 
 getParentId ()
 
 setExportMode ($a_export_mode=true)
 
 getExportMode ()
 
 validate ()
 
 update ()
 
 save ()
 
 delete ()
 
 toXML (&$writer)
 

Static Public Member Functions

static _lookupFirstLanguage ($a_rbac_id, $a_obj_id, $a_obj_type)
 Lookup first language. More...
 
static _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 

Additional Inherited Members

- Data Fields inherited from ilMD5295Base
 $rbac_id
 
 $obj_id
 
 $obj_type
 
 $export_mode = false
 
- Protected Attributes inherited from ilMD5295Base
 $log
 

Detailed Description

Definition at line 33 of file class.ilMD5295Language.php.

Member Function Documentation

◆ __getFields()

ilMD5295Language::__getFields ( )

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

References getLanguageCode(), ilMD5295Base\getObjId(), ilMD5295Base\getObjType(), ilMD5295Base\getParentId(), ilMD5295Base\getParentType(), and ilMD5295Base\getRBACId().

Referenced by save().

132  {
133  return array('rbac_id' => array('integer',$this->getRBACId()),
134  'obj_id' => array('integer',$this->getObjId()),
135  'obj_type' => array('text',$this->getObjType()),
136  'parent_type' => array('text',$this->getParentType()),
137  'parent_id' => array('integer',$this->getParentId()),
138  'language' => array('text',$this->getLanguageCode()));
139  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getIds()

static ilMD5295Language::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)
static

Definition at line 184 of file class.ilMD5295Language.php.

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilMD5295General\getLanguageIds(), and ilMD5295Educational\getLanguageIds().

185  {
186  global $DIC;
187 
188  $ilDB = $DIC['ilDB'];
189 
190  $query = "SELECT meta_language_id FROM il_meta_language " .
191  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
192  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
193  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
194  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
195 
196  $res = $ilDB->query($query);
197  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
198  $ids[] = $row->meta_language_id;
199  }
200  return $ids ? $ids : array();
201  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupFirstLanguage()

static ilMD5295Language::_lookupFirstLanguage (   $a_rbac_id,
  $a_obj_id,
  $a_obj_type 
)
static

Lookup first language.

public

Parameters

Definition at line 43 of file class.ilMD5295Language.php.

References $DIC, $ilDB, $lang, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

44  {
45  global $DIC;
46 
47  $ilDB = $DIC['ilDB'];
48 
49  $lang = '';
50  $query = "SELECT language FROM il_meta_language " .
51  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
52  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
53  "AND obj_type = " . $ilDB->quote($a_obj_type, 'text') . " " .
54  "AND parent_type = 'meta_general' " .
55  "ORDER BY meta_language_id ";
56  $ilDB->setLimit(1);
57  $res = $ilDB->query($query);
58  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
59  $lang = $row->language;
60  }
61  return $lang;
62  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
$lang
Definition: xapiexit.php:8
global $ilDB

◆ delete()

ilMD5295Language::delete ( )

Definition at line 114 of file class.ilMD5295Language.php.

References $DIC, $ilDB, $query, $res, and ilMD5295Base\getMetaId().

115  {
116  global $DIC;
117 
118  $ilDB = $DIC['ilDB'];
119 
120  if ($this->getMetaId()) {
121  $query = "DELETE FROM il_meta_language " .
122  "WHERE meta_language_id = " . $ilDB->quote($this->getMetaId(), 'integer');
123  $res = $ilDB->manipulate($query);
124 
125  return true;
126  }
127  return false;
128  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

◆ getLanguage()

& ilMD5295Language::getLanguage ( )

Definition at line 71 of file class.ilMD5295Language.php.

References language().

Referenced by toXML().

72  {
73  return is_object($this->language) ? $this->language : false;
74  }
language()
Definition: language.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLanguageCode()

ilMD5295Language::getLanguageCode ( )

Definition at line 75 of file class.ilMD5295Language.php.

References language().

Referenced by __getFields(), and toXML().

76  {
77  return is_object($this->language) ? $this->language->getLanguageCode() : false;
78  }
language()
Definition: language.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilMD5295Language::read ( )

Definition at line 141 of file class.ilMD5295Language.php.

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilMD5295Base\getMetaId(), setLanguage(), ilMD5295Base\setObjId(), ilMD5295Base\setObjType(), ilMD5295Base\setParentId(), ilMD5295Base\setParentType(), and ilMD5295Base\setRBACId().

142  {
143  global $DIC;
144 
145  $ilDB = $DIC['ilDB'];
146 
147  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.php';
148 
149  if ($this->getMetaId()) {
150  $query = "SELECT * FROM il_meta_language " .
151  "WHERE meta_language_id = " . $ilDB->quote($this->getMetaId(), 'integer');
152 
153  $res = $this->db->query($query);
154  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
155  $this->setRBACId($row->rbac_id);
156  $this->setObjId($row->obj_id);
157  $this->setObjType($row->obj_type);
158  $this->setParentId($row->parent_id);
159  $this->setParentType($row->parent_type);
160  $this->setLanguage(new ilMD5295LanguageItem($row->language));
161  }
162  }
163  return true;
164  }
setParentType($a_parent_type)
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

◆ save()

ilMD5295Language::save ( )

Definition at line 80 of file class.ilMD5295Language.php.

References $DIC, $ilDB, __getFields(), ilMD5295Base\getMetaId(), and ilMD5295Base\setMetaId().

81  {
82  global $DIC;
83 
84  $ilDB = $DIC['ilDB'];
85 
86  $fields = $this->__getFields();
87  $fields['meta_language_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_language'));
88 
89  if ($this->db->insert('il_meta_language', $fields)) {
90  $this->setMetaId($next_id);
91  return $this->getMetaId();
92  }
93  return false;
94  }
global $DIC
Definition: goto.php:24
global $ilDB
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ setLanguage()

ilMD5295Language::setLanguage ( $lng_obj)

Definition at line 65 of file class.ilMD5295Language.php.

References language().

Referenced by read().

66  {
67  if (is_object($lng_obj)) {
68  $this->language = &$lng_obj;
69  }
70  }
language()
Definition: language.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toXML()

ilMD5295Language::toXML ( $writer)

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

References getLanguage(), and getLanguageCode().

172  {
173  $writer->xmlElement(
174  'Language',
175  array('Language' => $this->getLanguageCode() ?
176  $this->getLanguageCode() :
177  'en'),
178  $this->getLanguage()
179  );
180  }
+ Here is the call graph for this function:

◆ update()

ilMD5295Language::update ( )

Definition at line 96 of file class.ilMD5295Language.php.

References $DIC, $ilDB, and ilMD5295Base\getMetaId().

97  {
98  global $DIC;
99 
100  $ilDB = $DIC['ilDB'];
101 
102  if ($this->getMetaId()) {
103  if ($this->db->update(
104  'il_meta_language',
105  $this->__getFields(),
106  array("meta_language_id" => array('integer',$this->getMetaId()))
107  )) {
108  return true;
109  }
110  }
111  return false;
112  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the call graph for this function:

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