ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilBasicSkillTemplate.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
28 {
29  public function __construct(int $a_id = 0)
30  {
31  parent::__construct($a_id);
32  $this->setType("sktp");
33  }
34 
38  public function copy(): ilBasicSkillTemplate
39  {
40  $skill = new ilBasicSkillTemplate();
41  $skill->setTitle($this->getTitle());
42  $skill->setDescription($this->getDescription());
43  $skill->setType($this->getType());
44  $skill->setOrderNr($this->getOrderNr());
45  $skill->create();
46 
47  $levels = $this->getLevelData();
48  if (sizeof($levels)) {
49  foreach ($levels as $item) {
50  $skill->addLevel($item["title"], $item["description"]);
51  }
52  }
53  $skill->update();
54 
55  return $skill;
56  }
57 
58  public function delete(): void
59  {
60  $ilDB = $this->db;
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 }
setType(string $a_type)
__construct(VocabulariesInterface $vocabularies)
getLevelData(int $a_id=0)
copy()
Copy basic skill template.
Basic Skill.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...