19 declare(strict_types=1);
39 $this->ass_mat_repo = (
$ass_mat_repo) ?: $DIC->skills()->internal()->repo()->getAssignedMaterialRepo();
40 $this->personal_repo = (
$personal_repo) ?: $DIC->skills()->internal()->repo()->getPersonalSkillRepo();
61 $this->ass_mat_repo->assign($user_id, $top_skill_id, $tref_id, $basic_skill_id, $level_id, $wsp_id);
70 return $this->ass_mat_repo->get($user_id, $tref_id, $level_id);
79 return $this->ass_mat_repo->getAll($user_id, $skill_id, $tref_id);
87 return $this->ass_mat_repo->count($user_id, $tref_id, $level_id);
92 $this->ass_mat_repo->remove($user_id, $tref_id, $level_id, $wsp_id);
97 $this->ass_mat_repo->removeAllForUser($user_id);
102 $this->ass_mat_repo->removeAllForSkill($skill_node_id, $is_reference);
112 $personal_repo = $DIC->skills()->internal()->repo()->getPersonalSkillRepo();
113 $usage_manager = $DIC->skills()->internal()->manager()->getUsageManager();
116 $usages = $usage_manager->getUsageInfoGeneric(
119 "skl_assigned_material",
126 foreach ($a_cskill_ids as $cs) {
127 $cs[
"tref_id"] = (
int) $cs[
"tref_id"];
128 $cs[
"skill_id"] = (
int) $cs[
"skill_id"];
129 if ($cs[
"tref_id"] > 0) {
131 $pskill_ids[$cs[
"tref_id"]] = $cs[
"tref_id"];
132 $tref_ids[$cs[
"tref_id"]] = $cs[
"skill_id"];
135 $pskill_ids[$cs[
"skill_id"]] = $cs[
"skill_id"];
138 $usages = $personal_repo->
getUsages($usages, $pskill_ids, $tref_ids);
static _lookupTemplateId(int $a_obj_id)
AssignedMaterialDBRepository $ass_mat_repo
removeAssignedMaterial(int $user_id, int $tref_id, int $level_id, int $wsp_id)
getUsages(array $usages, array $pskill_ids, array $tref_ids)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
removeAssignedMaterialsForSkill(int $skill_node_id, bool $is_reference=false)
__construct(?AssignedMaterialDBRepository $ass_mat_repo=null, ?PersonalSkillDBRepository $personal_repo=null)
removeAssignedMaterialsForUser(int $user_id)
getAllAssignedMaterialsForSkill(int $user_id, int $skill_id, int $tref_id)
Get all assigned materials (for a skill and user)
getAssignedMaterials(int $user_id, int $tref_id, int $level_id)
Get assigned materials (for a skill level and user)
assignMaterial(int $user_id, int $top_skill_id, int $tref_id, int $basic_skill_id, int $level_id, int $wsp_id)
Assign material to skill level.
PersonalSkillDBRepository $personal_repo
Get info on usages of skills.
static getUsageInfo(array $a_cskill_ids)
Get title of an assigned item.int, tref_id: int}[] $a_cskill_ids array of common skill idsarray<strin...
countAssignedMaterials(int $user_id, int $tref_id, int $level_id)
Count assigned materials (for a skill level and user)