29 $ilDB->manipulate(
"DELETE FROM skl_level WHERE " 30 .
" skill_id = " .
$ilDB->quote($skill_id,
"integer")
37 public function addLevel(
int $skill_id,
string $a_title,
string $a_description,
string $a_import_id =
"")
42 $nid =
$ilDB->nextId(
"skl_level");
43 $ilDB->insert(
"skl_level", array(
44 "id" => array(
"integer", $nid),
45 "skill_id" => array(
"integer", $skill_id),
46 "nr" => array(
"integer", $nr + 1),
47 "title" => array(
"text", $a_title),
48 "description" => array(
"clob", $a_description),
49 "import_id" => array(
"text", $a_import_id),
50 "creation_date" => array(
"timestamp",
ilUtil::now())
63 $set =
$ilDB->query(
"SELECT MAX(nr) mnr FROM skl_level WHERE " .
64 " skill_id = " .
$ilDB->quote($skill_id,
"integer")
66 $rec =
$ilDB->fetchAssoc($set);
67 return (
int) $rec[
"mnr"];
78 $and =
" AND id = " .
$ilDB->quote($a_id,
"integer");
81 $set =
$ilDB->query(
"SELECT * FROM skl_level WHERE " .
82 " skill_id = " .
$ilDB->quote($skill_id,
"integer") .
87 while ($rec =
$ilDB->fetchAssoc($set)) {
106 $set =
$ilDB->query(
"SELECT $a_prop FROM skl_level WHERE " .
107 " id = " .
$ilDB->quote($a_id,
"integer")
109 $rec =
$ilDB->fetchAssoc($set);
110 return $rec[$a_prop];
148 $ilDB->update(
"skl_level", array(
149 $a_prop => array($a_type, $a_value),
151 "id" => array(
"integer", $a_id),
179 foreach ($order as $id => $o) {
180 $ilDB->manipulate(
"UPDATE skl_level SET " .
181 " nr = " .
$ilDB->quote($cnt,
"integer") .
182 " WHERE id = " .
$ilDB->quote($id,
"integer")
195 $ilDB->manipulate(
"DELETE FROM skl_level WHERE " 196 .
" id = " .
$ilDB->quote($a_id,
"integer")
208 $set =
$ilDB->query(
"SELECT id, nr FROM skl_level WHERE " .
209 " skill_id = " .
$ilDB->quote($skill_id,
"integer") .
213 while ($rec =
$ilDB->fetchAssoc($set)) {
214 $ilDB->manipulate(
"UPDATE skl_level SET " .
215 " nr = " .
$ilDB->quote($cnt,
"integer") .
216 " WHERE id = " .
$ilDB->quote($rec[
"id"],
"integer")
229 $set =
$ilDB->query(
"SELECT * FROM skl_level WHERE " .
230 " id = " .
$ilDB->quote($a_level_id,
"integer")
233 if ($rec =
$ilDB->fetchAssoc($set)) {
updateLevelOrder(array $order)
addLevel(int $skill_id, string $a_title, string $a_description, string $a_import_id="")
Class ilBasicSkillLevelDBRepository.
writeLevelTitle(int $a_id, string $a_title)
lookupLevelTitle(int $a_id)
writeLevelProperty(int $a_id, string $a_prop, $a_value, string $a_type)
Write level property.
static now()
Return current timestamp in Y-m-d H:i:s format.
Interface ilBasicSkillLevelRepository.
__construct(ilDBInterface $db=null)
fixLevelNumbering(int $skill_id)
static isInTree($a_id)
Is id in tree?
lookupLevelSkillId(int $a_id)
getLevelData(int $skill_id, int $a_id=0)
writeLevelDescription(int $a_id, string $a_description)
deleteLevelsOfSkill(int $skill_id)
lookupLevelProperty(int $a_id, string $a_prop)
Lookup level property.
lookupLevelDescription(int $a_id)
getMaxLevelNr(int $skill_id)
Get maximum level nr.
getSkillForLevelId(int $a_level_id)