ILIAS  release_8 Revision v8.24
class.ilSkillCategory.php
Go to the documentation of this file.
1<?php
2
26{
27 public function __construct(int $a_id = 0)
28 {
30 $this->setType("scat");
31 }
32
33 public function copy(): ilSkillCategory
34 {
35 $scat = new ilSkillCategory();
36 $scat->setTitle($this->getTitle());
37 $scat->setDescription($this->getDescription());
38 $scat->setType($this->getType());
39 $scat->setSelfEvaluation($this->getSelfEvaluation());
40 $scat->setOrderNr($this->getOrderNr());
41 $scat->create();
42
43 return $scat;
44 }
45
46 public function delete(): void
47 {
48 $scat_id = $this->getId();
49 $skill_tree = $this->skill_service->internal()->repo()->getTreeRepo()->getTreeForNodeId($scat_id);
50 $childs = $skill_tree->getChildsByTypeFilter(
51 $scat_id,
52 ["skll", "scat", "sktr"]
53 );
54 foreach ($childs as $node) {
55 switch ($node["type"]) {
56 case "skll":
57 $obj = new ilBasicSkill((int) $node["obj_id"]);
58 $obj->delete();
59 break;
60
61 case "scat":
62 $obj = new ilSkillCategory((int) $node["obj_id"]);
63 $obj->delete();
64 break;
65
66 case "sktr":
67 $obj = new ilSkillTemplateReference((int) $node["obj_id"]);
68 $obj->delete();
69 break;
70 }
71 }
72
73 parent::delete();
74 }
75}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setType(string $a_type)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc