ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilBasicSkillTemplate.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
28 public function __construct(int $a_id = 0)
29 {
31 $this->setType("sktp");
32 }
33
37 public function copy(): ilBasicSkillTemplate
38 {
39 $skill = new ilBasicSkillTemplate();
40 $skill->setTitle($this->getTitle());
41 $skill->setDescription($this->getDescription());
42 $skill->setType($this->getType());
43 $skill->setOrderNr($this->getOrderNr());
44 $skill->create();
45
46 $levels = $this->getLevelData();
47 if (sizeof($levels)) {
48 foreach ($levels as $item) {
49 $skill->addLevel($item["title"], $item["description"]);
50 }
51 }
52 $skill->update();
53
54 return $skill;
55 }
56
57 public function delete(): void
58 {
60
61 $ilDB->manipulate(
62 "DELETE FROM skl_templ_ref WHERE "
63 . " templ_id = " . $ilDB->quote($this->getId(), "integer")
64 );
65
66 parent::delete();
67 }
68}
copy()
Copy basic skill template.
getLevelData(int $a_id=0)
setType(string $a_type)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc