37 $this->db = $DIC->database();
48 $ilDB = $DIC->database();
52 $set =
$ilDB->query(
"SELECT *" .
53 " FROM exc_crit_cat" .
54 " WHERE parent = " .
$ilDB->quote($a_parent_id,
"integer") .
56 while ($row =
$ilDB->fetchAssoc($set)) {
58 $obj->importFromDB($row);
59 $res[$obj->getId()] = $obj;
75 protected function setId(
int $a_id): void
82 $this->parent = $a_value;
90 public function setTitle(?
string $a_value): void
92 $this->title = $a_value;
102 $this->pos = $a_value;
117 $this->
setId((
int) $a_row[
"id"]);
118 $this->
setParent((
int) $a_row[
"parent"]);
119 $this->
setTitle((
string) $a_row[
"title"]);
126 "title" => array(
"text", $this->
getTitle())
139 $set =
$ilDB->query(
"SELECT MAX(pos) pos" .
140 " FROM exc_crit_cat" .
141 " WHERE parent = " .
$ilDB->quote($this->getParent(),
"integer"));
142 $row =
$ilDB->fetchAssoc($set);
143 return (
int) $row[
"pos"];
146 protected function read(?
int $a_id): void
151 $set =
$ilDB->query(
"SELECT *" .
152 " FROM exc_crit_cat" .
153 " WHERE id = " .
$ilDB->quote($a_id,
"integer"));
154 if (
$ilDB->numRows($set) !== 0) {
155 $row =
$ilDB->fetchAssoc($set);
170 $this->
id =
$ilDB->nextId(
"exc_crit_cat");
173 $fields[
"parent"] = array(
"integer", $this->
getParent());
175 $fields[
"id"] = array(
"integer", $this->
id);
177 $ilDB->insert(
"exc_crit_cat", $fields);
189 $primary = array(
"id" => array(
"integer", $this->
id));
193 public function delete():
void 203 $ilDB->manipulate(
"DELETE FROM exc_crit_cat" .
204 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
209 $new_obj =
new self();
210 $new_obj->setParent($a_target_parent_id);
211 $new_obj->setTitle($this->
getTitle());
216 $crit->cloneObject($new_obj->getId());
219 return $new_obj->getId();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(?string $a_value)
static getInstancesByParentId(int $a_parent_id)
static getInstancesByParentId(int $a_parent_id)
__construct(?int $a_id=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static deleteByParent(int $a_parent_id)
setPosition(int $a_value)
cloneObject(int $a_target_parent_id)
importFromDB(array $a_row)