ILIAS  trunk Revision v11.0_alpha-1861-g09f3d197f78
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 28 of file class.ilGlobalVirtualSkillTree.php.

Constructor & Destructor Documentation

◆ __construct()

ilGlobalVirtualSkillTree::__construct ( )

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

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

36  {
37  global $DIC;
38 
40  $this->skill_tree_manager = $DIC->skills()->internal()->manager()->getTreeManager();
41  $this->skill_tree_factory = $DIC->skills()->internal()->factory()->tree();
42  $this->tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
43  }
global $DIC
Definition: shib_login.php:22
__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 64 of file class.ilGlobalVirtualSkillTree.php.

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

64  : array
65  {
66  if ($a_parent_id === "0") {
67  $childs = [];
68  $trees = $this->skill_tree_manager->getTrees();
69  foreach ($trees as $obj_tree) {
70  $tree = $this->skill_tree_factory->getTreeById($obj_tree->getId());
72  $data["id"] = $data["child"];
73  $childs[] = $data;
74  }
75  return $childs;
76  } else {
77  $parent_id_parts = explode(":", $a_parent_id);
78  $parent_skl_tree_id = (int) $parent_id_parts[0];
79  $tree_id = $this->tree_repo->getTreeIdForNodeId($parent_skl_tree_id);
80  $this->tree = $this->skill_tree_factory->getTreeById($tree_id);
81  return parent::getChildsOfNode($a_parent_id);
82  }
83  }
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 48 of file class.ilGlobalVirtualSkillTree.php.

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

◆ 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 88 of file class.ilGlobalVirtualSkillTree.php.

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

88  : array
89  {
90  return array_merge(
91  [$this->getNode($a_tree_id)],
92  $this->__getSubTreeRec($a_tree_id, false)
93  );
94  }
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 30 of file class.ilGlobalVirtualSkillTree.php.

◆ $skill_tree_factory

SkillTreeFactory ilGlobalVirtualSkillTree::$skill_tree_factory
protected

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

◆ $skill_tree_manager

SkillTreeManager ilGlobalVirtualSkillTree::$skill_tree_manager
protected

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

◆ $tree_repo

ilSkillTreeRepository ilGlobalVirtualSkillTree::$tree_repo
protected

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


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