ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.SurveySkillDBRepository.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
23 
28 {
29  protected \ilDBInterface $db;
30 
31  public function __construct(
32  \ilDBInterface $db = null
33  ) {
34  global $DIC;
35 
36  $this->db = ($db) ?: $DIC->database();
37  }
38 
39  public function removeForSkill(int $skill_node_id, bool $is_reference): void
40  {
41  if (!$is_reference) {
42  $this->db->manipulate("DELETE FROM svy_quest_skill " .
43  " WHERE base_skill_id = " . $this->db->quote($skill_node_id, "integer"));
44  $this->db->manipulate("DELETE FROM svy_skill_threshold " .
45  " WHERE base_skill_id = " . $this->db->quote($skill_node_id, "integer"));
46  } else {
47  $this->db->manipulate("DELETE FROM svy_quest_skill " .
48  " WHERE tref_id = " . $this->db->quote($skill_node_id, "integer"));
49  $this->db->manipulate("DELETE FROM svy_skill_threshold " .
50  " WHERE tref_id = " . $this->db->quote($skill_node_id, "integer"));
51  }
52  }
53 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
removeForSkill(int $skill_node_id, bool $is_reference)