ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilGlobalVirtualSkillTree Class Reference

Global virtual skill tree. More...

+ Inheritance diagram for ilGlobalVirtualSkillTree:
+ Collaboration diagram for ilGlobalVirtualSkillTree:

Public Member Functions

 __construct ()
 
 getRootNode ()
 
 getChildsOfNode (string $a_parent_id)
 
 getSubTreeForTreeId (string $a_tree_id)
 
- Public Member Functions inherited from ilVirtualSkillTree
 __construct (int $tree_id)
 
 getRootNode ()
 
 setIncludeDrafts (bool $a_val)
 
 getIncludeDrafts ()
 
 setIncludeOutdated (bool $a_val)
 
 getIncludeOutdated ()
 
 getNode (string $a_vtree_id)
 
 getChildsOfNode (string $a_parent_id)
 
 getChildsOfNodeForCSkillId (string $a_cskill_id)
 
 getCSkillIdForVTreeId (string $a_vtree_id)
 
 getVTreeIdForCSkillId (string $a_cskill_id)
 
 getNodeTitle (array $a_node)
 
 getSubTreeForCSkillId (string $a_cskill_id, bool $a_only_basic=false)
 
 isDraft (string $a_node_id)
 
 isOutdated (string $a_node_id)
 
 getOrderedNodeset (array $c_skill_ids, string $a_skill_id_key="", string $a_tref_id_key="")
 Get ordererd nodeset for common skill ids. More...
 

Protected Attributes

bool $root_node_processed = false
 
SkillTreeManager $skill_tree_manager
 
SkillTreeFactory $skill_tree_factory
 
ilSkillTreeRepository $tree_repo
 
- Protected Attributes inherited from ilVirtualSkillTree
ilLanguage $lng
 
ilSkillTree $tree
 
bool $include_drafts = false
 
array $drafts = []
 
bool $include_outdated = false
 
array $outdated = []
 

Additional Inherited Members

- Protected Member Functions inherited from ilVirtualSkillTree
 __getSubTreeRec (string $id, bool $a_only_basic)
 
 getPath (string $a, array $node_data)
 get path in node data More...
 
 getFirstUncommonAncestors (string $a, string $b, array $node_data)
 get first uncommon ancestors of $a and $b in $node_data More...
 
- Static Protected Attributes inherited from ilVirtualSkillTree
static array $order_node_data = null
 

Detailed Description

Global virtual skill tree.

Author
Thomas Famula famul.nosp@m.a@le.nosp@m.ifos..nosp@m.de

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

Constructor & Destructor Documentation

◆ __construct()

ilGlobalVirtualSkillTree::__construct ( )

Definition at line 34 of file class.ilGlobalVirtualSkillTree.php.

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

35  {
36  global $DIC;
37 
39  $this->skill_tree_manager = $DIC->skills()->internal()->manager()->getTreeManager();
40  $this->skill_tree_factory = $DIC->skills()->internal()->factory()->tree();
41  $this->tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
42  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getChildsOfNode()

ilGlobalVirtualSkillTree::getChildsOfNode ( string  $a_parent_id)
Returns
array{id: int, child: int, parent: int}[]

Definition at line 63 of file class.ilGlobalVirtualSkillTree.php.

References $data, ilVirtualSkillTree\$tree, ilTree\getNodeData(), ILIAS\Repository\int(), and ilTree\readRootId().

63  : array
64  {
65  if ($a_parent_id === "0") {
66  $childs = [];
67  $trees = $this->skill_tree_manager->getTrees();
68  foreach ($trees as $obj_tree) {
69  $tree = $this->skill_tree_factory->getTreeById($obj_tree->getId());
71  $data["id"] = $data["child"];
72  $childs[] = $data;
73  }
74  return $childs;
75  } else {
76  $parent_id_parts = explode(":", $a_parent_id);
77  $parent_skl_tree_id = (int) $parent_id_parts[0];
78  $tree_id = $this->tree_repo->getTreeIdForNodeId($parent_skl_tree_id);
79  $this->tree = $this->skill_tree_factory->getTreeById($tree_id);
80  return parent::getChildsOfNode($a_parent_id);
81  }
82  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
+ Here is the call graph for this function:

◆ getRootNode()

ilGlobalVirtualSkillTree::getRootNode ( )
Returns
array{id: int, parent: int, depth: int, obj_id: int}

Definition at line 47 of file class.ilGlobalVirtualSkillTree.php.

47  : array
48  {
49  $root_id = 0;
50  $root_node = $this->tree->getNodeData($root_id);
51 
52  $root_node["id"] = 0;
53  $root_node["parent"] = 0;
54  $root_node["depth"] = 0;
55  $root_node["obj_id"] = 0;
56 
57  return $root_node;
58  }

◆ getSubTreeForTreeId()

ilGlobalVirtualSkillTree::getSubTreeForTreeId ( string  $a_tree_id)
Returns
{cskill_id: string, id: string, skill_id: string, tref_id: string, parent: string, type: string}[]

Definition at line 87 of file class.ilGlobalVirtualSkillTree.php.

References ilVirtualSkillTree\__getSubTreeRec(), and ilVirtualSkillTree\getNode().

87  : array
88  {
89  return array_merge(
90  [$this->getNode($a_tree_id)],
91  $this->__getSubTreeRec($a_tree_id, false)
92  );
93  }
getNode(string $a_vtree_id)
__getSubTreeRec(string $id, bool $a_only_basic)
+ Here is the call graph for this function:

Field Documentation

◆ $root_node_processed

bool ilGlobalVirtualSkillTree::$root_node_processed = false
protected

Definition at line 29 of file class.ilGlobalVirtualSkillTree.php.

◆ $skill_tree_factory

SkillTreeFactory ilGlobalVirtualSkillTree::$skill_tree_factory
protected

Definition at line 31 of file class.ilGlobalVirtualSkillTree.php.

◆ $skill_tree_manager

SkillTreeManager ilGlobalVirtualSkillTree::$skill_tree_manager
protected

Definition at line 30 of file class.ilGlobalVirtualSkillTree.php.

◆ $tree_repo

ilSkillTreeRepository ilGlobalVirtualSkillTree::$tree_repo
protected

Definition at line 32 of file class.ilGlobalVirtualSkillTree.php.


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