ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilBasicSkillTemplate.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 {
21 $this->setType("sktp");
22 }
23
27 public function copy()
28 {
29 $skill = new ilBasicSkillTemplate();
30 $skill->setTitle($this->getTitle());
31 $skill->setDescription($this->getDescription());
32 $skill->setType($this->getType());
33 $skill->setOrderNr($this->getOrderNr());
34 $skill->create();
35
36 $levels = $this->getLevelData();
37 if (sizeof($levels)) {
38 foreach ($levels as $item) {
39 $skill->addLevel($item["title"], $item["description"]);
40 }
41 }
42 $skill->update();
43
44 return $skill;
45 }
46
47 public function delete(): void
48 {
50
53 $node_data = $this->skill_tree->getNodeData($tref_id);
54 if (is_object($obj)) {
55 $obj->delete();
56 }
57 if ($this->skill_tree->isInTree($tref_id)) {
58 $this->skill_tree->deleteTree($node_data);
59 }
60 }
61
62 $ilDB->manipulate(
63 "DELETE FROM skl_templ_ref WHERE "
64 . " templ_id = " . $ilDB->quote($this->getId(), "integer")
65 );
66
67 parent::delete();
68 }
69}
An exception for terminatinating execution or to throw for unit testing.
copy()
Copy basic skill template.
__construct($a_id=0)
Constructor @access public.
getLevelData(int $a_id=0)
static _lookupTrefIdsForTopTemplateId($a_template_id)
Lookup tref ids for template id.
getDescription()
Get description.
setType($a_type)
Set type.
getOrderNr()
Get order nr.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilDB