19 declare(strict_types=1);
35 $ilDB = $DIC->database();
38 $query =
"SELECT language FROM il_meta_language " .
39 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
40 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
41 "AND obj_type = " .
$ilDB->quote($a_obj_type,
'text') .
" " .
42 "AND parent_type = 'meta_general' " .
43 "ORDER BY meta_language_id ";
44 $ilDB->setLimit(1, 0);
47 $lang = $row->language;
71 $fields[
'meta_language_id'] = array(
'integer', $next_id = $this->db->nextId(
'il_meta_language'));
72 if ($this->db->insert(
'il_meta_language', $fields)) {
81 return $this->
getMetaId() && $this->db->update(
84 array(
"meta_language_id" => array(
'integer', $this->
getMetaId()))
88 public function delete():
bool 91 $query =
"DELETE FROM il_meta_language " .
92 "WHERE meta_language_id = " . $this->db->quote($this->
getMetaId(),
'integer');
93 $res = $this->db->manipulate($query);
106 'rbac_id' => array(
'integer', $this->
getRBACId()),
107 'obj_id' => array(
'integer', $this->
getObjId()),
108 'obj_type' => array(
'text', $this->
getObjType()),
110 'parent_id' => array(
'integer', $this->
getParentId()),
118 $query =
"SELECT * FROM il_meta_language " .
119 "WHERE meta_language_id = " . $this->db->quote($this->
getMetaId(),
'integer');
121 $res = $this->db->query($query);
124 $this->
setObjId((
int) $row->obj_id);
150 public static function _getIds(
int $a_rbac_id,
int $a_obj_id,
int $a_parent_id,
string $a_parent_type): array
154 $ilDB = $DIC->database();
156 $query =
"SELECT meta_language_id FROM il_meta_language " .
157 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
158 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
159 "AND parent_id = " .
$ilDB->quote($a_parent_id,
'integer') .
" " .
160 "AND parent_type = " .
$ilDB->quote($a_parent_type,
'text');
165 $ids[] = (
int) $row->meta_language_id;
static _lookupFirstLanguage(int $a_rbac_id, int $a_obj_id, string $a_obj_type)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setLanguage(ilMDLanguageItem $lng_obj)
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
toXML(ilXmlWriter $writer)
setParentType(string $a_parent_type)
ilMDLanguageItem $language
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
language()
description: > Example for rendring a language glyph.
setMetaId(int $a_meta_id, bool $a_read_data=true)
setObjType(string $a_type)