ILIAS  release_8 Revision v8.24
class.ilBasicSkillTemplate.php
Go to the documentation of this file.
1<?php
2
26{
27 public function __construct(int $a_id = 0)
28 {
30 $this->setType("sktp");
31 }
32
36 public function copy(): ilBasicSkillTemplate
37 {
38 $skill = new ilBasicSkillTemplate();
39 $skill->setTitle($this->getTitle());
40 $skill->setDescription($this->getDescription());
41 $skill->setType($this->getType());
42 $skill->setOrderNr($this->getOrderNr());
43 $skill->create();
44
45 $levels = $this->getLevelData();
46 if (sizeof($levels)) {
47 foreach ($levels as $item) {
48 $skill->addLevel($item["title"], $item["description"]);
49 }
50 }
51 $skill->update();
52
53 return $skill;
54 }
55
56 public function delete(): void
57 {
59
62 $skill_tree = $this->skill_service->internal()->repo()->getTreeRepo()->getTreeForNodeId($tref_id);
63 $node_data = $skill_tree->getNodeData($tref_id);
64 if (is_object($obj)) {
65 $obj->delete();
66 }
67 if ($skill_tree->isInTree($tref_id)) {
68 $skill_tree->deleteTree($node_data);
69 }
70 }
71
72 $ilDB->manipulate(
73 "DELETE FROM skl_templ_ref WHERE "
74 . " templ_id = " . $ilDB->quote($this->getId(), "integer")
75 );
76
77 parent::delete();
78 }
79}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
copy()
Copy basic skill template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getLevelData(int $a_id=0)
static _lookupTrefIdsForTopTemplateId(int $a_template_id)
setType(string $a_type)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc