3 declare(strict_types=1);
26 protected \ilDBInterface
$db;
35 $this->db = (
$db) ?: $DIC->database();
36 $this->factory_service = (
$factory_service) ?: $DIC->skills()->internalContainer()->factory();
39 public function add(
int $cont_obj_id,
int $skill_id,
int $tref_id): void
44 "id" => [
"integer", $cont_obj_id],
45 "skill_id" => [
"integer", $skill_id],
46 "tref_id" => [
"integer", $tref_id]
52 public function remove(
int $cont_obj_id,
int $skill_id,
int $tref_id):
void 54 $this->db->manipulate(
55 "DELETE FROM cont_skills WHERE " .
56 " id = " . $this->db->quote($cont_obj_id,
"integer") .
57 " AND skill_id = " . $this->db->quote($skill_id,
"integer") .
58 " AND tref_id = " . $this->db->quote($tref_id,
"integer")
65 $this->db->manipulate(
"DELETE FROM cont_skills " .
66 " WHERE skill_id = " . $this->db->quote($skill_node_id,
"integer"));
68 $this->db->manipulate(
"DELETE FROM cont_skills " .
69 " WHERE tref_id = " . $this->db->quote($skill_node_id,
"integer"));
76 public function getAll(
int $cont_obj_id): array
79 $set = $this->db->query(
80 "SELECT * FROM cont_skills " .
81 " WHERE id = " . $this->db->quote($cont_obj_id,
"integer")
84 while ($rec = $this->db->fetchAssoc($set)) {
92 $rec[
"skill_id"] = (
int) $rec[
"skill_id"];
93 $rec[
"tref_id"] = (
int) $rec[
"tref_id"];
94 $rec[
"id"] = (
int) $rec[
"id"];
96 return $this->factory_service->containerSkill()->skill(
removeForSkill(int $skill_node_id, bool $is_reference)
__construct(\ilDBInterface $db=null, SkillInternalFactoryService $factory_service=null,)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
add(int $cont_obj_id, int $skill_id, int $tref_id)
SkillInternalFactoryService $factory_service
getContainerSkillFromRecord(array $rec)