ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSkillDataSet Class Reference

Skill Data set class. More...

+ Inheritance diagram for ilSkillDataSet:
+ Collaboration diagram for ilSkillDataSet:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setMode ($a_val)
 Set mode. More...
 
 getMode ()
 Get mode. More...
 
 setSelectedNodes ($a_val)
 Set export selected nodes. More...
 
 getSelectedNodes ()
 Get export selected nodes. More...
 
 setSelectedProfiles ($a_val)
 Set selected profiles. More...
 
 getSelectedProfiles ()
 Get selected profiles. More...
 
 getSupportedVersions ()
 Get supported versions. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 readData ($a_entity, $a_version, $a_ids, $a_field="")
 Read data. More...
 
 importRecord ($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 Import record. More...
 
- Public Member Functions inherited from ilDataSet
 __construct ()
 Constructor. More...
 
 init ($a_entity, $a_schema_version)
 Init. More...
 
 getSupportedVersions ()
 Get supported version. More...
 
 readData ($a_entity, $a_version, $a_ids)
 Read data from DB. More...
 
 setExportDirectories ($a_relative, $a_absolute)
 Set export directories. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setDSPrefix ($a_val)
 Set XML dataset namespace prefix. More...
 
 getDSPrefix ()
 Get XML dataset namespace prefix. More...
 
 getDSPrefixString ()
 
 getDirectDataFromQuery ($a_query, $a_convert_to_leading_upper=true, $a_set=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields. More...
 
 convertToLeadingUpper ($a_str)
 Make xyz_abc a XyzAbc string. More...
 
 getJsonRepresentation ()
 Get json representation. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_ids, $a_field="", $a_omit_header=false, $a_omit_types=false)
 Get xml representation <dataset install_id="123" install_url="..."> <types entity="table_name" version="4.0.1"> <ftype name="field_1" type="text"> <ftype name="field_2" type="date"> <ftype name="field_3" type="integer"> </types> <types ...> ... More...
 
 addRecordsXml ($a_writer, $a_prefixes, $a_entity, $a_schema_version, $a_ids, $a_field="")
 Add records xml. More...
 
 afterXmlRecordWriting ($a_entity, $a_version, $a_set)
 After xml record writing hook record. More...
 
 getNamespaces (&$namespaces, $a_entity, $a_schema_version)
 Get xml namespaces. More...
 
 getXmlRecord ($a_entity, $a_version, $a_set)
 Get xml record for version. More...
 
 getJsonRecord ($a_set)
 Get json record for version. More...
 
 getXmlTypes ($a_entity, $a_version)
 Get xml types. More...
 
 getJsonTypes ($a_entity, $a_version)
 Get json types. More...
 
 getXMLEntityName ($a_entity, $a_version)
 Get entity name for xml (may be overwritten) More...
 
 getXMLEntityTag ($a_entity, $a_schema_version)
 Get entity tag. More...
 
 getJsonEntityName ($a_entity, $a_version)
 Get entity name for json (may be overwritten) More...
 
 setImport ($a_val)
 Set import object. More...
 
 getImport ()
 Get import object. More...
 
 setCurrentInstallationId ($a_val)
 Set current installation id. More...
 
 getCurrentInstallationId ()
 Get current installation id. More...
 

Data Fields

const MODE_SKILLS = ""
 
const MODE_PROFILES = "prof"
 
- Data Fields inherited from ilDataSet
 $dircnt
 
const EXPORT_NO_INST_ID = 1
 
const EXPORT_ID_ILIAS_LOCAL = 2
 
const EXPORT_ID_ILIAS_LOCAL_INVALID = 3
 
const EXPORT_ID_ILIAS_REMOTE = 4
 
const EXPORT_ID_ILIAS_REMOTE_INVALID = 5
 
const EXPORT_ID = 6
 
const EXPORT_ID_INVALID = 7
 

Protected Member Functions

 getTypes ($a_entity, $a_version)
 Get field types for entity. More...
 
 getDependencies ($a_entity, $a_version, $a_rec, $a_ids)
 Determine the dependent sets of data. More...
 
- Protected Member Functions inherited from ilDataSet
 getTypes ($a_entity, $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 createObjectExportId ($a_type, $a_id)
 Build ilias export id. More...
 
 parseObjectExportId ($a_id, $a_fallback_id=NULL)
 Parse export id. More...
 

Protected Attributes

 $skill_tree
 
 $init_order_nr
 
 $selected_nodes = false
 
 $selected_profiles = false
 
 $mode = ""
 
- Protected Attributes inherited from ilDataSet
 $current_installation_id = ""
 

Detailed Description

Skill Data set class.

This class implements the following entities:

  • skmg: Skill management top entity (no data, only dependecies)
  • skl_subtree: Skill subtree (includes data of skl_tree, skl_tree_node and skl_templ_ref)
  • skl_templ_subtree: Skill template subtree (includes data of skl_tree and skl_tree_node)
  • skl_level: Skill levels
  • skl_prof: skill profiles (different mode)
Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 20 of file class.ilSkillDataSet.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillDataSet::__construct ( )

Constructor.

Definition at line 37 of file class.ilSkillDataSet.php.

38  {
39  parent::__construct();
40  include_once("./Services/Skill/classes/class.ilSkillTree.php");
41  $this->skill_tree = new ilSkillTree();
42  $this->skill_tree_root_id = $this->skill_tree->readRootId();
43 
44  $this->init_top_order_nr = $this->skill_tree->getMaxOrderNr($this->skill_tree_root_id);
45  $this->init_templ_top_order_nr = $this->skill_tree->getMaxOrderNr($this->skill_tree_root_id, true);
46  }
Skill tree.

Member Function Documentation

◆ getDependencies()

ilSkillDataSet::getDependencies (   $a_entity,
  $a_version,
  $a_rec,
  $a_ids 
)
protected

Determine the dependent sets of data.

Definition at line 375 of file class.ilSkillDataSet.php.

References $ilDB, $n, ilSkillTreeNode\_lookupType(), array, getMode(), getSelectedNodes(), and getSelectedProfiles().

376  {
377  global $ilDB;
378 
379  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
380 
381  switch ($a_entity)
382  {
383  case "skmg":
384 
385  if ($this->getMode() == self::MODE_SKILLS)
386  {
387  // determine top nodes of main tree to be exported and all referenced template nodes
388  $sel_nodes = $this->getSelectedNodes();
389  $exp_types = array("skll", "scat", "sctr", "sktr");
390  if (!is_array($sel_nodes))
391  {
392  $childs = $this->skill_tree->getChildsByTypeFilter($this->skill_tree->readRootId(), $exp_types);
393  $deps = array();
394  $skl_subtree_deps = array();
395  foreach ($childs as $c)
396  {
397  $skl_subtree_deps[] = $c["child"];
398  }
399  } else
400  {
401  foreach ($sel_nodes as $n)
402  {
403  if (in_array(ilSkillTreeNode::_lookupType((int)$n), $exp_types))
404  {
405  $skl_subtree_deps[] = $n;
406  }
407  }
408  }
409 
410  // determine template subtrees
411  $ref_nodes = array();
412  if (is_array($skl_subtree_deps))
413  {
414  foreach ($skl_subtree_deps as $id)
415  {
416  if (ilSkillTreeNode::_lookupType($id) == "sktr")
417  {
418  $ref_nodes[$id] = $id;
419  } else
420  {
421  $sub = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($id), true, "sktr");
422  foreach ($sub as $s)
423  {
424  $ref_nodes[$s["child"]] = $s["child"];
425  }
426  }
427  }
428  }
429 
430  $set = $ilDB->query("SELECT DISTINCT(templ_id) FROM skl_templ_ref " .
431  " WHERE " . $ilDB->in("skl_node_id", $ref_nodes, false, "integer"));
432  while ($rec = $ilDB->fetchAssoc($set))
433  {
434  $deps["skl_templ_subtree"]["ids"][] = $rec["templ_id"];
435  }
436 
437  // export subtree after templates
438  $deps["skl_subtree"]["ids"] = $skl_subtree_deps;
439  }
440  else if ($this->getMode() == self::MODE_PROFILES)
441  {
442  foreach ($this->getSelectedProfiles() as $p_id)
443  {
444  $deps["skl_prof"]["ids"][] = $p_id;
445  }
446  }
447 
448  return $deps;
449 
450  case "skl_subtree":
451  case "skl_templ_subtree":
452  $deps = array();
453  if (in_array($a_rec["Type"], array("skll", "sktp")))
454  {
455  $deps["skl_level"]["ids"][] = $a_rec["Child"];
456  }
457  return $deps;
458 
459  case "skl_prof":
460  $deps["skl_prof_level"]["ids"][] = $a_rec["Id"];
461  return $deps;
462  }
463 
464  return false;
465  }
getSelectedNodes()
Get export selected nodes.
static _lookupType($a_obj_id)
Lookup Type.
$n
Definition: RandomTest.php:80
Create styles array
The data for the language used.
getSelectedProfiles()
Get selected profiles.
global $ilDB
+ Here is the call graph for this function:

◆ getMode()

ilSkillDataSet::getMode ( )

Get mode.

Returns
string mode

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

References $mode.

Referenced by getDependencies(), and readData().

64  {
65  return $this->mode;
66  }
+ Here is the caller graph for this function:

◆ getSelectedNodes()

ilSkillDataSet::getSelectedNodes ( )

Get export selected nodes.

Returns
array array of int

Definition at line 83 of file class.ilSkillDataSet.php.

References $selected_nodes.

Referenced by getDependencies().

84  {
85  return $this->selected_nodes;
86  }
+ Here is the caller graph for this function:

◆ getSelectedProfiles()

ilSkillDataSet::getSelectedProfiles ( )

Get selected profiles.

Returns
array array of int (profile ids)

Definition at line 103 of file class.ilSkillDataSet.php.

References $selected_profiles.

Referenced by getDependencies().

104  {
106  }
+ Here is the caller graph for this function:

◆ getSupportedVersions()

ilSkillDataSet::getSupportedVersions ( )

Get supported versions.

Returns
array of version strings

Definition at line 113 of file class.ilSkillDataSet.php.

References array.

114  {
115  return array("5.1.0");
116  }
Create styles array
The data for the language used.

◆ getTypes()

ilSkillDataSet::getTypes (   $a_entity,
  $a_version 
)
protected

Get field types for entity.

Parameters

Definition at line 135 of file class.ilSkillDataSet.php.

References array.

136  {
137  if ($a_entity == "skmg")
138  {
139  switch ($a_version)
140  {
141  case "5.1.0":
142  return array(
143  "Mode" => "text"
144  );
145  }
146  }
147  if ($a_entity == "skl_subtree")
148  {
149  switch ($a_version)
150  {
151  case "5.1.0":
152  return array(
153  "SklTreeId" => "integer",
154  "TopNode" => "integer",
155  "Child" => "integer",
156  "Parent" => "integer",
157  "Depth" => "integer",
158  "Type" => "text",
159  "Title" => "text",
160  "SelfEval" => "integer",
161  "OrderNr" => "integer",
162  "Status" => "integer",
163  "TemplateId" => "integer"
164  );
165  }
166  }
167  if ($a_entity == "skl_templ_subtree")
168  {
169  switch ($a_version)
170  {
171  case "5.1.0":
172  return array(
173  "SklTreeId" => "integer",
174  "TopNode" => "integer",
175  "Child" => "integer",
176  "Parent" => "integer",
177  "Depth" => "integer",
178  "Type" => "text",
179  "Title" => "text",
180  "SelfEval" => "integer",
181  "OrderNr" => "integer",
182  "Status" => "integer"
183  );
184  }
185  }
186  if ($a_entity == "skl_level")
187  {
188  switch ($a_version)
189  {
190  case "5.1.0":
191  return array(
192  "LevelId" => "integer",
193  "SkillId" => "integer",
194  "Nr" => "integer",
195  "Title" => "text",
196  "Description" => "text"
197  );
198  }
199  }
200  if ($a_entity == "skl_prof")
201  {
202  switch ($a_version)
203  {
204  case "5.1.0":
205  return array(
206  "Id" => "integer",
207  "Title" => "text",
208  "Description" => "text"
209  );
210  }
211  }
212  if ($a_entity == "skl_prof_level")
213  {
214  switch ($a_version)
215  {
216  case "5.1.0":
217  return array(
218  "ProfileId" => "integer",
219  "BaseSkillId" => "integer",
220  "TrefId" => "integer",
221  "LevelId" => "integer"
222  );
223  }
224  }
225  return array();
226  }
Create styles array
The data for the language used.

◆ getXmlNamespace()

ilSkillDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

Definition at line 124 of file class.ilSkillDataSet.php.

125  {
126  return "http://www.ilias.de/xml/Services/Skill/".$a_entity;
127  }

◆ importRecord()

ilSkillDataSet::importRecord (   $a_entity,
  $a_types,
  $a_rec,
  $a_mapping,
  $a_schema_version 
)

Import record.

Parameters

Definition at line 474 of file class.ilSkillDataSet.php.

References $l, $template_id, ilSkillTreeNode\_lookupType(), array, ilBasicSkill\getCommonSkillIdForImportId(), ilDataSet\getCurrentInstallationId(), ilBasicSkill\getLevelIdForImportId(), ilBasicSkill\lookupLevelSkillId(), ilSkillTreeNode\putInTree(), and ilSkillTreeNode\STATUS_DRAFT.

475  {
476  $source_inst_id = $a_mapping->getInstallId();
477  switch ($a_entity)
478  {
479  case "skl_subtree":
480  if ($a_rec["TopNode"] == 1)
481  {
482  $parent = $this->skill_tree_root_id;
484  $order = $a_rec["OrderNr"] + $this->init_top_order_nr;
485  } else
486  {
487  $parent = (int)$a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["Parent"]);
488  $status = $a_rec["Status"];
489  $order = $a_rec["OrderNr"];
490  }
491  switch ($a_rec["Type"])
492  {
493  case "scat":
494  include_once("./Services/Skill/classes/class.ilSkillCategory.php");
495  $scat = new ilSkillCategory();
496  $scat->setTitle($a_rec["Title"]);
497  $scat->setImportId("il_" . $source_inst_id . "_scat_" . $a_rec["Child"]);
498  $scat->setSelfEvaluation($a_rec["SelfEval"]);
499  $scat->setOrderNr($order);
500  $scat->setStatus($status);
501  $scat->create();
502  ilSkillTreeNode::putInTree($scat, $parent);
503  $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $scat->getId());
504  break;
505 
506  case "skll":
507  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
508  $skll = new ilBasicSkill();
509  $skll->setTitle($a_rec["Title"]);
510  $skll->setImportId("il_" . $source_inst_id . "_skll_" . $a_rec["Child"]);
511  $skll->setSelfEvaluation($a_rec["SelfEval"]);
512  $skll->setOrderNr($order);
513  $skll->setStatus($status);
514  $skll->create();
515  ilSkillTreeNode::putInTree($skll, $parent);
516  $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $skll->getId());
517  break;
518 
519  case "sktr":
520  $template_id = (int)$a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["TemplateId"]);
521  // only create template references, if referenced template is found (template trees are imported first)
522  if ($template_id > 0)
523  {
524  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
525  $sktr = new ilSkillTemplateReference();
526  $sktr->setTitle($a_rec["Title"]);
527  $sktr->setImportId("il_" . $source_inst_id . "_sktr_" . $a_rec["Child"]);
528  $sktr->setSelfEvaluation($a_rec["SelfEval"]);
529  $sktr->setOrderNr($order);
530  $sktr->setSkillTemplateId($template_id);
531  $sktr->setStatus($status);
532  $sktr->create();
533  ilSkillTreeNode::putInTree($sktr, $parent);
534  $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $sktr->getId());
535  }
536  break;
537 
538  }
539  break;
540 
541  case "skl_templ_subtree":
542  if ($a_rec["TopNode"] == 1)
543  {
544  $parent = $this->skill_tree_root_id;
545  $order = $a_rec["OrderNr"] + $this->init_templ_top_order_nr;
546  } else
547  {
548  $parent = (int)$a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["Parent"]);
549  $order = $a_rec["OrderNr"];
550  }
551  switch ($a_rec["Type"])
552  {
553  case "sctp":
554  include_once("./Services/Skill/classes/class.ilSkillTemplateCategory.php");
555  $sctp = new ilSkillTemplateCategory();
556  $sctp->setTitle($a_rec["Title"]);
557  $sctp->setImportId("il_" . $source_inst_id . "_sctp_" . $a_rec["Child"]);
558  $sctp->setOrderNr($order);
559  $sctp->create();
560  ilSkillTreeNode::putInTree($sctp, $parent);
561  $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $sctp->getId());
562  break;
563 
564  case "sktp":
565  include_once("./Services/Skill/classes/class.ilBasicSkillTemplate.php");
566  $sktp = new ilBasicSkillTemplate();
567  $sktp->setTitle($a_rec["Title"]);
568  $sktp->setImportId("il_" . $source_inst_id . "_sktp_" . $a_rec["Child"]);
569  $sktp->setOrderNr($order);
570  $sktp->create();
571  ilSkillTreeNode::putInTree($sktp, $parent);
572  $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $sktp->getId());
573  break;
574  }
575  break;
576 
577  case "skl_level":
578  $skill_id = (int)$a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["SkillId"]);
579  $type = ilSkillTreeNode::_lookupType($skill_id);
580  if (in_array($type, array("skll", "sktp")))
581  {
582  if ($type == "skll")
583  {
584  $skill = new ilBasicSkill($skill_id);
585  } else
586  {
587  $skill = new ilBasicSkillTemplate($skill_id);
588  }
589  $skill->addLevel($a_rec["Title"], $a_rec["Description"], "il_" . $source_inst_id . "_sklv_" . $a_rec["LevelId"]);
590  $skill->update();
591  }
592  break;
593 
594  case "skl_prof":
595  include_once("./Services/Skill/classes/class.ilSkillProfile.php");
596  $prof = new ilSkillProfile();
597  $prof->setTitle($a_rec["Title"]);
598  $prof->setDescription($a_rec["Description"]);
599  $prof->create();
600  $a_mapping->addMapping("Services/Skill", "skl_prof", $a_rec["Id"], $prof->getId());
601  break;
602 
603  case "skl_prof_level":
604  $profile_id = (int)$a_mapping->getMapping("Services/Skill", "skl_prof", $a_rec["ProfileId"]);
605  if ($profile_id > 0)
606  {
607  include_once("./Services/Skill/classes/class.ilSkillProfile.php");
608  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
609  $prof = new ilSkillProfile($profile_id);
610  $level_id_data = ilBasicSkill::getLevelIdForImportId($this->getCurrentInstallationId(), $a_rec["LevelId"]);
611  $skill_data = ilBasicSkill::getCommonSkillIdForImportId($this->getCurrentInstallationId(), $a_rec["BaseSkillId"], $a_rec["TrefId"]);
612  //var_dump($level_id_data);
613  //var_dump($skill_data);
614  $level_id = $tref_id = $base_skill = 0;
615  foreach($level_id_data as $l)
616  {
617  reset($skill_data);
618  foreach ($skill_data as $s)
619  {
620  // echo "<br>=".ilBasicSkill::lookupLevelSkillId($l["level_id"])."=".$s["skill_id"]."=";
621 
622  if ($level_id == 0 && ilBasicSkill::lookupLevelSkillId($l["level_id"]) == $s["skill_id"])
623  {
624  $level_id = $l["level_id"];
625  $base_skill = $s["skill_id"];
626  $tref_id = $s["tref_id"];
627  }
628  }
629  }
630  if ($level_id > 0)
631  {
632  $prof->addSkillLevel($base_skill, $tref_id, $level_id);
633  }
634  $prof->update();
635  }
636  break;
637  }
638  }
$template_id
Definition: example_062.php:89
static getLevelIdForImportId($a_source_inst_id, $a_level_import_id)
Get level ids for import IDs (newest first)
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
static _lookupType($a_obj_id)
Lookup Type.
getCurrentInstallationId()
Get current installation id.
Create styles array
The data for the language used.
global $l
Definition: afr.php:30
static lookupLevelSkillId($a_id)
Lookup level skill id.
Basic Skill.
static getCommonSkillIdForImportId($a_source_inst_id, $a_skill_import_id, $a_tref_import_id=0)
Get common skill ids for import IDs (newest first)
+ Here is the call graph for this function:

◆ readData()

ilSkillDataSet::readData (   $a_entity,
  $a_version,
  $a_ids,
  $a_field = "" 
)

Read data.

Parameters

Definition at line 234 of file class.ilSkillDataSet.php.

References $ilDB, array, data, ilDataSet\getDirectDataFromQuery(), and getMode().

235  {
236  global $ilDB;
237 
238  $this->data = array();
239 
240  if (!is_array($a_ids))
241  {
242  $a_ids = array($a_ids);
243  }
244  if ($a_entity == "skmg") // dummy node
245  {
246  switch ($a_version)
247  {
248  case "5.1.0":
249  if ($this->getMode() == self::MODE_SKILLS)
250  {
251  $this->data[] = array("Mode" => "Skills");
252  }
253  else if ($this->getMode() == self::MODE_PROFILES)
254  {
255  $this->data[] = array("Mode" => "Profiles");
256  }
257  break;
258 
259  }
260  }
261  if ($a_entity == "skl_subtree") // get subtree for top node
262  {
263  switch ($a_version)
264  {
265  case "5.1.0":
266  foreach ($a_ids as $id)
267  {
268  $sub = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($id));
269  foreach ($sub as $s)
270  {
271  $set = $ilDB->query("SELECT * FROM skl_templ_ref ".
272  " WHERE skl_node_id = ".$ilDB->quote($s["child"], "integer")
273  );
274  $rec = $ilDB->fetchAssoc($set);
275 
276  $top_node = ($s["child"] == $id)
277  ? 1
278  : 0;
279  $this->data[] = array(
280  "SklTreeId" => $s["skl_tree_id"],
281  "TopNode" => $top_node,
282  "Child" => $s["child"],
283  "Parent" => $s["parent"],
284  "Depth" => $s["depth"],
285  "Type" => $s["type"],
286  "Title" => $s["title"],
287  "SelfEval" => $s["self_eval"],
288  "OrderNr" => $s["order_nr"],
289  "Status" => $s["status"],
290  "TemplateId" => (int) $rec["templ_id"]
291  );
292  }
293  }
294  break;
295 
296  }
297  }
298 
299  if ($a_entity == "skl_templ_subtree") // get template subtree for template id
300  {
301  switch ($a_version)
302  {
303  case "5.1.0":
304  foreach ($a_ids as $id)
305  {
306  $sub = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($id));
307  foreach ($sub as $s)
308  {
309  $top_node = ($s["child"] == $id)
310  ? 1
311  : 0;
312  $this->data[] = array(
313  "SklTreeId" => $s["skl_tree_id"],
314  "TopNode" => $top_node,
315  "Child" => $s["child"],
316  "Parent" => $s["parent"],
317  "Depth" => $s["depth"],
318  "Type" => $s["type"],
319  "Title" => $s["title"],
320  "SelfEval" => $s["self_eval"],
321  "OrderNr" => $s["order_nr"],
322  "Status" => $s["status"]
323  );
324  }
325  }
326  break;
327 
328  }
329  }
330 
331  if ($a_entity == "skl_level")
332  {
333  switch ($a_version)
334  {
335  case "5.1.0":
336  $this->getDirectDataFromQuery("SELECT id level_id, skill_id, nr, title, description".
337  " FROM skl_level WHERE ".
338  $ilDB->in("skill_id", $a_ids, false, "integer")." ORDER BY skill_id ASC, nr ASC");
339  break;
340 
341  }
342  }
343 
344  if ($a_entity == "skl_prof")
345  {
346  switch ($a_version)
347  {
348  case "5.1.0":
349  $this->getDirectDataFromQuery("SELECT id, title, description".
350  " FROM skl_profile WHERE ".
351  $ilDB->in("id", $a_ids, false, "integer"));
352  break;
353 
354  }
355  }
356 
357  if ($a_entity == "skl_prof_level")
358  {
359  switch ($a_version)
360  {
361  case "5.1.0":
362  $this->getDirectDataFromQuery("SELECT profile_id, base_skill_id, tref_id, level_id".
363  " FROM skl_profile_level WHERE ".
364  $ilDB->in("profile_id", $a_ids, false, "integer"));
365  break;
366 
367  }
368  }
369 
370  }
Add some data
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ setMode()

ilSkillDataSet::setMode (   $a_val)

Set mode.

Parameters
string$a_valmode

Definition at line 53 of file class.ilSkillDataSet.php.

54  {
55  $this->mode = $a_val;
56  }

◆ setSelectedNodes()

ilSkillDataSet::setSelectedNodes (   $a_val)

Set export selected nodes.

Parameters
array$a_valarray of int

Definition at line 73 of file class.ilSkillDataSet.php.

74  {
75  $this->selected_nodes = $a_val;
76  }

◆ setSelectedProfiles()

ilSkillDataSet::setSelectedProfiles (   $a_val)

Set selected profiles.

Parameters
array$a_valarray of int (profile ids)

Definition at line 93 of file class.ilSkillDataSet.php.

94  {
95  $this->selected_profiles = $a_val;
96  }

Field Documentation

◆ $init_order_nr

ilSkillDataSet::$init_order_nr
protected

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

◆ $mode

ilSkillDataSet::$mode = ""
protected

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

Referenced by getMode().

◆ $selected_nodes

ilSkillDataSet::$selected_nodes = false
protected

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

Referenced by getSelectedNodes().

◆ $selected_profiles

ilSkillDataSet::$selected_profiles = false
protected

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

Referenced by getSelectedProfiles().

◆ $skill_tree

ilSkillDataSet::$skill_tree
protected

Definition at line 28 of file class.ilSkillDataSet.php.

◆ MODE_PROFILES

const ilSkillDataSet::MODE_PROFILES = "prof"

Definition at line 23 of file class.ilSkillDataSet.php.

◆ MODE_SKILLS

const ilSkillDataSet::MODE_SKILLS = ""

Definition at line 22 of file class.ilSkillDataSet.php.


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