26 protected int $id = 0;
40 $this->db = $DIC->database();
41 if ($a_id > 0 && $a_lang !=
"") {
48 public function setId(
int $a_val): void
58 public function setLang(
string $a_val): void
70 $this->title = $a_val;
80 $this->short_title = $a_val;
98 public function read(): void
103 "SELECT * FROM lm_data_transl " .
104 " WHERE id = " .
$ilDB->quote($this->getId(),
"integer") .
105 " AND lang = " .
$ilDB->quote($this->getLang(),
"text")
107 $rec =
$ilDB->fetchAssoc($set);
108 $this->
setTitle($rec[
"title"] ??
"");
110 $this->create_date = ($rec[
"create_date"] ?? 0);
111 $this->last_update = ($rec[
"last_update"] ?? 0);
119 $ilDB->manipulate(
"INSERT INTO lm_data_transl " .
120 "(id, lang, title, short_title, create_date, last_update) VALUES (" .
121 $ilDB->quote($this->getId(),
"integer") .
"," .
122 $ilDB->quote($this->getLang(),
"text") .
"," .
123 $ilDB->quote($this->getTitle(),
"text") .
"," .
124 $ilDB->quote($this->getShortTitle(),
"text") .
"," .
130 "UPDATE lm_data_transl SET " .
131 " title = " .
$ilDB->quote($this->getTitle(),
"text") .
"," .
132 " short_title = " .
$ilDB->quote($this->getShortTitle(),
"text") .
"," .
133 " last_update = " .
$ilDB->now() .
134 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer") .
149 $ilDB = $DIC->database();
152 "SELECT * FROM lm_data_transl " .
153 " WHERE id = " .
$ilDB->quote($a_id,
"integer") .
154 " AND lang = " .
$ilDB->quote($a_lang,
"text")
156 if ($rec =
$ilDB->fetchAssoc($set)) {
171 $ilDB = $DIC->database();
174 "SELECT * FROM lm_data_transl " .
175 " WHERE id = " .
$ilDB->quote($a_source_id,
"integer")
177 while ($rec =
$ilDB->fetchAssoc($set)) {
179 $lmobjtrans->setTitle((
string) $rec[
"title"]);
180 $lmobjtrans->setShortTitle((
string) $rec[
"short_title"]);
setShortTitle(string $a_val)
static copy(string $a_source_id, string $a_target_id)
Copy all translations of an object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(int $a_id=0, string $a_lang="")
static exists(int $a_id, string $a_lang)
Check for existence.