ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.SurveySkillDBRepository.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27{
28 protected \ilDBInterface $db;
29
30 public function __construct(
31 ?\ilDBInterface $db = null
32 ) {
33 global $DIC;
34
35 $this->db = ($db) ?: $DIC->database();
36 }
37
38 public function removeForSkill(int $skill_node_id, bool $is_reference): void
39 {
40 if (!$is_reference) {
41 $this->db->manipulate("DELETE FROM svy_quest_skill " .
42 " WHERE base_skill_id = " . $this->db->quote($skill_node_id, "integer"));
43 $this->db->manipulate("DELETE FROM svy_skill_threshold " .
44 " WHERE base_skill_id = " . $this->db->quote($skill_node_id, "integer"));
45 } else {
46 $this->db->manipulate("DELETE FROM svy_quest_skill " .
47 " WHERE tref_id = " . $this->db->quote($skill_node_id, "integer"));
48 $this->db->manipulate("DELETE FROM svy_skill_threshold " .
49 " WHERE tref_id = " . $this->db->quote($skill_node_id, "integer"));
50 }
51 }
52}
removeForSkill(int $skill_node_id, bool $is_reference)
Interface ilDBInterface.
global $DIC
Definition: shib_login.php:26