19 declare(strict_types=1);
25 protected \ilDBInterface
$db;
34 $this->db = (
$db) ?: $DIC->database();
35 $this->factory_service = (
$factory_service) ?: $DIC->skills()->internalContainer()->factory();
38 public function add(
int $cont_obj_id,
int $skill_id,
int $tref_id): void
43 "id" => [
"integer", $cont_obj_id],
44 "skill_id" => [
"integer", $skill_id],
45 "tref_id" => [
"integer", $tref_id]
51 public function remove(
int $cont_obj_id,
int $skill_id,
int $tref_id):
void 53 $this->db->manipulate(
54 "DELETE FROM cont_skills WHERE " .
55 " id = " . $this->db->quote($cont_obj_id,
"integer") .
56 " AND skill_id = " . $this->db->quote($skill_id,
"integer") .
57 " AND tref_id = " . $this->db->quote($tref_id,
"integer")
64 $this->db->manipulate(
"DELETE FROM cont_skills " .
65 " WHERE skill_id = " . $this->db->quote($skill_node_id,
"integer"));
67 $this->db->manipulate(
"DELETE FROM cont_skills " .
68 " WHERE tref_id = " . $this->db->quote($skill_node_id,
"integer"));
75 public function getAll(
int $cont_obj_id): array
78 $set = $this->db->query(
79 "SELECT * FROM cont_skills " .
80 " WHERE id = " . $this->db->quote($cont_obj_id,
"integer")
83 while ($rec = $this->db->fetchAssoc($set)) {
91 $rec[
"skill_id"] = (
int) $rec[
"skill_id"];
92 $rec[
"tref_id"] = (
int) $rec[
"tref_id"];
93 $rec[
"id"] = (
int) $rec[
"id"];
95 return $this->factory_service->containerSkill()->skill(
removeForSkill(int $skill_node_id, bool $is_reference)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
add(int $cont_obj_id, int $skill_id, int $tref_id)
SkillInternalFactoryService $factory_service
__construct(?\ilDBInterface $db=null, ?SkillInternalFactoryService $factory_service=null,)
getContainerSkillFromRecord(array $rec)