ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilSkillCategory.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
11 {
12  public $id;
13 
18  public function __construct($a_id = 0)
19  {
20  parent::__construct($a_id);
21  $this->setType("scat");
22  }
23 
27  public function read()
28  {
29  parent::read();
30  }
31 
36  public function create()
37  {
38  parent::create();
39  }
40 
44  public function delete()
45  {
46  $scat_id = $this->getId();
47  $childs = $this->skill_tree->getChildsByTypeFilter(
48  $scat_id,
49  ["skll", "scat", "sktr"]
50  );
51  foreach ($childs as $node) {
52  switch ($node["type"]) {
53  case "skll":
54  $obj = new ilBasicSkill((int) $node["obj_id"]);
55  $obj->delete();
56  break;
57 
58  case "scat":
59  $obj = new ilSkillCategory((int) $node["obj_id"]);
60  $obj->delete();
61  break;
62 
63  case "sktr":
64  $obj = new ilSkillTemplateReference((int) $node["obj_id"]);
65  $obj->delete();
66  break;
67  }
68  }
69 
70  parent::delete();
71  }
72 
76  public function copy()
77  {
78  $scat = new ilSkillCategory();
79  $scat->setTitle($this->getTitle());
80  $scat->setDescription($this->getDescription());
81  $scat->setType($this->getType());
82  $scat->setSelfEvaluation($this->getSelfEvaluation());
83  $scat->setOrderNr($this->getOrderNr());
84  $scat->create();
85 
86  return $scat;
87  }
88 }
setType($a_type)
Set type.
getDescription()
Get description.
create()
Create skill.
getSelfEvaluation()
Get self evaluation.
getOrderNr()
Get order nr.
copy()
Copy skill category.
__construct($a_id=0)
Constructor public.
__construct(Container $dic, ilPlugin $plugin)
A node in the skill tree.
read()
Read data from database.
Basic Skill.