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);
120 $ilDB->manipulate(
"INSERT INTO lm_data_transl " .
121 "(id, lang, title, short_title, create_date, last_update) VALUES (" .
122 $ilDB->quote($this->getId(),
"integer") .
"," .
123 $ilDB->quote($this->getLang(),
"text") .
"," .
125 $ilDB->quote($this->getShortTitle(),
"text") .
"," .
131 "UPDATE lm_data_transl SET " .
133 " short_title = " .
$ilDB->quote($this->getShortTitle(),
"text") .
"," .
134 " last_update = " .
$ilDB->now() .
135 " WHERE id = " .
$ilDB->quote($this->getId(),
"integer") .
136 " AND lang = " .
$ilDB->quote($this->getLang(),
"text")
153 "SELECT * FROM lm_data_transl " .
154 " WHERE id = " .
$ilDB->quote($a_id,
"integer") .
155 " AND lang = " .
$ilDB->quote($a_lang,
"text")
157 if ($rec =
$ilDB->fetchAssoc($set)) {
175 "SELECT * FROM lm_data_transl " .
176 " WHERE id = " .
$ilDB->quote($a_source_id,
"integer")
178 while ($rec =
$ilDB->fetchAssoc($set)) {
180 $lmobjtrans->setTitle((
string) $rec[
"title"]);
181 $lmobjtrans->setShortTitle((
string) $rec[
"short_title"]);
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="")
setShortTitle(string $a_val)
static copy(string $a_source_id, string $a_target_id)
Copy all translations of an object.
static exists(int $a_id, string $a_lang)
Check for existence.