ILIAS  release_8 Revision v8.23
ilSkillTemplateCategory Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilSkillTemplateCategory:
+ Collaboration diagram for ilSkillTemplateCategory:

Public Member Functions

 __construct (int $a_id=0)
 
 copy ()
 
 delete ()
 
- Public Member Functions inherited from ilSkillTreeNode
 __construct (int $a_id=0)
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setDescription (string $a_description)
 
 getDescription ()
 
 setType (string $a_type)
 
 getType ()
 
 setId (int $a_id)
 
 getId ()
 
 setSelfEvaluation (bool $a_val)
 
 getSelfEvaluation ()
 
 setOrderNr (int $a_val)
 
 getOrderNr ()
 
 setImportId (string $a_val)
 
 getImportId ()
 
 getCreationDate ()
 
 read ()
 Read Data of Node. More...
 
 setDataRecord (array $a_record)
 this method should only be called by class ilSCORM2004NodeFactory More...
 
 setStatus (int $a_val)
 
 getStatus ()
 
 create ()
 Create Node. More...
 
 update ()
 Update Node. More...
 
 delete ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilSkillTreeNode
static getAllStatus ()
 Get all status as array, key is value, value is lang text. More...
 
static getStatusInfo (int $a_status)
 
static _lookupTitle (int $a_obj_id, int $a_tref_id=0)
 
static _lookupDescription (int $a_obj_id)
 
static _lookupSelfEvaluation (int $a_obj_id)
 
static _lookupStatus (int $a_obj_id)
 
static _lookupType (int $a_obj_id)
 
static _writeTitle (int $a_obj_id, string $a_title)
 
static _writeDescription (int $a_obj_id, string $a_description)
 
static _writeOrderNr (int $a_obj_id, int $a_nr)
 
static uniqueTypesCheck (array $a_items)
 Check for unique types. More...
 
static getAllSelfEvaluationNodes ()
 
static getSelectableSkills ()
 
static getIconPath (int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
 
static getAllCSkillIdsForNodeIds (array $a_node_ids)
 Get all possible common skill IDs for node IDs. More...
 
- Data Fields inherited from ilSkillTreeNode
const STATUS_PUBLISH = 0
 
const STATUS_DRAFT = 1
 
const STATUS_OUTDATED = 2
 
- Protected Member Functions inherited from ilSkillTreeNode
 setCreationDate (string $a_val)
 
- Static Protected Member Functions inherited from ilSkillTreeNode
static _lookup (int $a_obj_id, string $a_field)
 
- Protected Attributes inherited from ilSkillTreeNode
ilDBInterface $db
 
ILIAS Skill Service SkillService $skill_service
 
string $type = ""
 
int $id = 0
 
string $title = ""
 
string $description = ""
 
bool $self_eval = false
 
int $order_nr = 0
 
string $import_id = ""
 
string $creation_date = ""
 
int $status = 0
 
array $data_record = []
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Skill Template Category

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 25 of file class.ilSkillTemplateCategory.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateCategory::__construct ( int  $a_id = 0)

Definition at line 27 of file class.ilSkillTemplateCategory.php.

References ILIAS\GlobalScreen\Provider\__construct(), and ilSkillTreeNode\setType().

28  {
29  parent::__construct($a_id);
30  $this->setType("sctp");
31  }
setType(string $a_type)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ copy()

ilSkillTemplateCategory::copy ( )

Definition at line 33 of file class.ilSkillTemplateCategory.php.

References ilSkillTreeNode\getDescription(), ilSkillTreeNode\getOrderNr(), ilSkillTreeNode\getTitle(), and ilSkillTreeNode\getType().

34  {
35  $sctp = new ilSkillTemplateCategory();
36  $sctp->setTitle($this->getTitle());
37  $sctp->setDescription($this->getDescription());
38  $sctp->setType($this->getType());
39  $sctp->setOrderNr($this->getOrderNr());
40  $sctp->create();
41 
42  return $sctp;
43  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ delete()

ilSkillTemplateCategory::delete ( )

Definition at line 45 of file class.ilSkillTemplateCategory.php.

References ilSkillTreeNode\$db, $ilDB, ilSkillTemplateReference\_lookupTrefIdsForTopTemplateId(), ilSkillTreeNode\getId(), and ilSkillTreeNodeFactory\getInstance().

45  : void
46  {
47  $ilDB = $this->db;
48 
49  $sctp_id = $this->getId();
50  $skill_tree = $this->skill_service->internal()->repo()->getTreeRepo()->getTreeForNodeId($sctp_id);
51  $childs = $skill_tree->getChildsByTypeFilter(
52  $sctp_id,
53  ["sktp", "sctp"]
54  );
55  foreach ($childs as $node) {
56  switch ($node["type"]) {
57  case "sktp":
58  $obj = new ilBasicSkillTemplate((int) $node["obj_id"]);
59  $obj->delete();
60  break;
61 
62  case "sctp":
63  $obj = new ilSkillTemplateCategory((int) $node["obj_id"]);
64  $obj->delete();
65  break;
66  }
67  }
68 
69  foreach (\ilSkillTemplateReference::_lookupTrefIdsForTopTemplateId($sctp_id) as $tref_id) {
70  $obj = ilSkillTreeNodeFactory::getInstance($tref_id);
71  $skill_tree = $this->skill_service->internal()->repo()->getTreeRepo()->getTreeForNodeId($tref_id);
72  $node_data = $skill_tree->getNodeData($tref_id);
73  if (is_object($obj)) {
74  $obj->delete();
75  }
76  if ($skill_tree->isInTree($tref_id)) {
77  $skill_tree->deleteTree($node_data);
78  }
79  }
80 
81  $ilDB->manipulate(
82  "DELETE FROM skl_templ_ref WHERE "
83  . " templ_id = " . $ilDB->quote($this->getId(), "integer")
84  );
85 
86  parent::delete();
87  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTrefIdsForTopTemplateId(int $a_template_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: