ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ...> ... </types> <set entity="table_name"> <rec> <field_1>content</field_1> <field_2>my_date</field_2> <field_3>my_number</field_3> </rec> ... </set> </dataset> 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 = ""
 
 $db
 
 $ds_log
 

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.

Reimplemented from ilDataSet.

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

38 {
39 global $DIC;
40
41 $this->db = $DIC->database();
43 include_once("./Services/Skill/classes/class.ilSkillTree.php");
44 $this->skill_tree = new ilSkillTree();
45 $this->skill_tree_root_id = $this->skill_tree->readRootId();
46
47 $this->init_top_order_nr = $this->skill_tree->getMaxOrderNr($this->skill_tree_root_id);
48 $this->init_templ_top_order_nr = $this->skill_tree->getMaxOrderNr($this->skill_tree_root_id, true);
49 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getDependencies()

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

Determine the dependent sets of data.

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

351 {
353
354 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
355
356 switch ($a_entity) {
357 case "skmg":
358
359 if ($this->getMode() == self::MODE_SKILLS) {
360 // determine top nodes of main tree to be exported and all referenced template nodes
361 $sel_nodes = $this->getSelectedNodes();
362 $exp_types = array("skll", "scat", "sctr", "sktr");
363 if (!is_array($sel_nodes)) {
364 $childs = $this->skill_tree->getChildsByTypeFilter($this->skill_tree->readRootId(), $exp_types);
365 $deps = array();
366 $skl_subtree_deps = array();
367 foreach ($childs as $c) {
368 $skl_subtree_deps[] = $c["child"];
369 }
370 } else {
371 foreach ($sel_nodes as $n) {
372 if (in_array(ilSkillTreeNode::_lookupType((int) $n), $exp_types)) {
373 $skl_subtree_deps[] = $n;
374 }
375 }
376 }
377
378 // determine template subtrees
379 $ref_nodes = array();
380 if (is_array($skl_subtree_deps)) {
381 foreach ($skl_subtree_deps as $id) {
382 if (ilSkillTreeNode::_lookupType($id) == "sktr") {
383 $ref_nodes[$id] = $id;
384 } else {
385 $sub = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($id), true, "sktr");
386 foreach ($sub as $s) {
387 $ref_nodes[$s["child"]] = $s["child"];
388 }
389 }
390 }
391 }
392
393 $set = $ilDB->query("SELECT DISTINCT(templ_id) FROM skl_templ_ref " .
394 " WHERE " . $ilDB->in("skl_node_id", $ref_nodes, false, "integer"));
395 while ($rec = $ilDB->fetchAssoc($set)) {
396 $deps["skl_templ_subtree"]["ids"][] = $rec["templ_id"];
397 }
398
399 // export subtree after templates
400 $deps["skl_subtree"]["ids"] = $skl_subtree_deps;
401 } elseif ($this->getMode() == self::MODE_PROFILES) {
402 foreach ($this->getSelectedProfiles() as $p_id) {
403 $deps["skl_prof"]["ids"][] = $p_id;
404 }
405 }
406
407 return $deps;
408
409 case "skl_subtree":
410 case "skl_templ_subtree":
411 $deps = array();
412 if (in_array($a_rec["Type"], array("skll", "sktp"))) {
413 $deps["skl_level"]["ids"][] = $a_rec["Child"];
414 }
415 return $deps;
416
417 case "skl_prof":
418 $deps["skl_prof_level"]["ids"][] = $a_rec["Id"];
419 return $deps;
420 }
421
422 return false;
423 }
$n
Definition: RandomTest.php:85
getSelectedNodes()
Get export selected nodes.
getSelectedProfiles()
Get selected profiles.
static _lookupType($a_obj_id)
Lookup Type.
global $ilDB

References Vendor\Package\$c, ilDataSet\$db, $ilDB, $n, ilSkillTreeNode\_lookupType(), getMode(), getSelectedNodes(), and getSelectedProfiles().

+ Here is the call graph for this function:

◆ getMode()

ilSkillDataSet::getMode ( )

Get mode.

Returns
string mode

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

67 {
68 return $this->mode;
69 }

References $mode.

Referenced by getDependencies(), and readData().

+ Here is the caller graph for this function:

◆ getSelectedNodes()

ilSkillDataSet::getSelectedNodes ( )

Get export selected nodes.

Returns
array array of int

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

References $selected_nodes.

Referenced by getDependencies().

+ Here is the caller graph for this function:

◆ getSelectedProfiles()

ilSkillDataSet::getSelectedProfiles ( )

Get selected profiles.

Returns
array array of int (profile ids)

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

107 {
109 }

References $selected_profiles.

Referenced by getDependencies().

+ Here is the caller graph for this function:

◆ getSupportedVersions()

ilSkillDataSet::getSupportedVersions ( )

Get supported versions.

Returns
array of version strings

Reimplemented from ilDataSet.

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

117 {
118 return array("5.1.0");
119 }

◆ getTypes()

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

Get field types for entity.

Parameters

return

Reimplemented from ilDataSet.

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

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

◆ getXmlNamespace()

ilSkillDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

return

Reimplemented from ilDataSet.

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

128 {
129 return "http://www.ilias.de/xml/Services/Skill/" . $a_entity;
130 }

◆ importRecord()

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

Import record.

Parameters

return

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

433 {
434 $source_inst_id = $a_mapping->getInstallId();
435 switch ($a_entity) {
436 case "skl_subtree":
437 if ($a_rec["TopNode"] == 1) {
438 $parent = $this->skill_tree_root_id;
440 $order = $a_rec["OrderNr"] + $this->init_top_order_nr;
441 } else {
442 $parent = (int) $a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["Parent"]);
443 $status = $a_rec["Status"];
444 $order = $a_rec["OrderNr"];
445 }
446 switch ($a_rec["Type"]) {
447 case "scat":
448 include_once("./Services/Skill/classes/class.ilSkillCategory.php");
449 $scat = new ilSkillCategory();
450 $scat->setTitle($a_rec["Title"]);
451 $scat->setDescription($a_rec["Description"]);
452 $scat->setImportId("il_" . $source_inst_id . "_scat_" . $a_rec["Child"]);
453 $scat->setSelfEvaluation($a_rec["SelfEval"]);
454 $scat->setOrderNr($order);
455 $scat->setStatus($status);
456 $scat->create();
457 ilSkillTreeNode::putInTree($scat, $parent);
458 $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $scat->getId());
459 break;
460
461 case "skll":
462 include_once("./Services/Skill/classes/class.ilBasicSkill.php");
463 $skll = new ilBasicSkill();
464 $skll->setTitle($a_rec["Title"]);
465 $skll->setDescription($a_rec["Description"]);
466 $skll->setImportId("il_" . $source_inst_id . "_skll_" . $a_rec["Child"]);
467 $skll->setSelfEvaluation($a_rec["SelfEval"]);
468 $skll->setOrderNr($order);
469 $skll->setStatus($status);
470 $skll->create();
471 ilSkillTreeNode::putInTree($skll, $parent);
472 $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $skll->getId());
473 break;
474
475 case "sktr":
476 $template_id = (int) $a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["TemplateId"]);
477 // only create template references, if referenced template is found (template trees are imported first)
478 if ($template_id > 0) {
479 include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
480 $sktr = new ilSkillTemplateReference();
481 $sktr->setTitle($a_rec["Title"]);
482 $sktr->setDescription($a_rec["Description"]);
483 $sktr->setImportId("il_" . $source_inst_id . "_sktr_" . $a_rec["Child"]);
484 $sktr->setSelfEvaluation($a_rec["SelfEval"]);
485 $sktr->setOrderNr($order);
486 $sktr->setSkillTemplateId($template_id);
487 $sktr->setStatus($status);
488 $sktr->create();
489 ilSkillTreeNode::putInTree($sktr, $parent);
490 $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $sktr->getId());
491 }
492 break;
493
494 }
495 break;
496
497 case "skl_templ_subtree":
498 if ($a_rec["TopNode"] == 1) {
499 $parent = $this->skill_tree_root_id;
500 $order = $a_rec["OrderNr"] + $this->init_templ_top_order_nr;
501 } else {
502 $parent = (int) $a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["Parent"]);
503 $order = $a_rec["OrderNr"];
504 }
505 switch ($a_rec["Type"]) {
506 case "sctp":
507 include_once("./Services/Skill/classes/class.ilSkillTemplateCategory.php");
508 $sctp = new ilSkillTemplateCategory();
509 $sctp->setTitle($a_rec["Title"]);
510 $sctp->setDescription($a_rec["Description"]);
511 $sctp->setImportId("il_" . $source_inst_id . "_sctp_" . $a_rec["Child"]);
512 $sctp->setOrderNr($order);
513 $sctp->create();
514 ilSkillTreeNode::putInTree($sctp, $parent);
515 $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $sctp->getId());
516 break;
517
518 case "sktp":
519 include_once("./Services/Skill/classes/class.ilBasicSkillTemplate.php");
520 $sktp = new ilBasicSkillTemplate();
521 $sktp->setTitle($a_rec["Title"]);
522 $sktp->setDescription($a_rec["Description"]);
523 $sktp->setImportId("il_" . $source_inst_id . "_sktp_" . $a_rec["Child"]);
524 $sktp->setOrderNr($order);
525 $sktp->create();
526 ilSkillTreeNode::putInTree($sktp, $parent);
527 $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $sktp->getId());
528 break;
529 }
530 break;
531
532 case "skl_level":
533 $skill_id = (int) $a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["SkillId"]);
535 if (in_array($type, array("skll", "sktp"))) {
536 if ($type == "skll") {
537 $skill = new ilBasicSkill($skill_id);
538 } else {
539 $skill = new ilBasicSkillTemplate($skill_id);
540 }
541 $skill->addLevel($a_rec["Title"], $a_rec["Description"], "il_" . $source_inst_id . "_sklv_" . $a_rec["LevelId"]);
542 $skill->update();
543 }
544 break;
545
546 case "skl_prof":
547 include_once("./Services/Skill/classes/class.ilSkillProfile.php");
548 $prof = new ilSkillProfile();
549 $prof->setTitle($a_rec["Title"]);
550 $prof->setDescription($a_rec["Description"]);
551 $prof->create();
552 $a_mapping->addMapping("Services/Skill", "skl_prof", $a_rec["Id"], $prof->getId());
553 break;
554
555 case "skl_prof_level":
556 $profile_id = (int) $a_mapping->getMapping("Services/Skill", "skl_prof", $a_rec["ProfileId"]);
557 if ($profile_id > 0) {
558 include_once("./Services/Skill/classes/class.ilSkillProfile.php");
559 include_once("./Services/Skill/classes/class.ilBasicSkill.php");
560 $prof = new ilSkillProfile($profile_id);
561 $level_id_data = ilBasicSkill::getLevelIdForImportId($this->getCurrentInstallationId(), $a_rec["LevelId"]);
562 $skill_data = ilBasicSkill::getCommonSkillIdForImportId($this->getCurrentInstallationId(), $a_rec["BaseSkillId"], $a_rec["TrefId"]);
563 //var_dump($level_id_data);
564 //var_dump($skill_data);
565 $level_id = $tref_id = $base_skill = 0;
566 foreach ($level_id_data as $l) {
567 reset($skill_data);
568 foreach ($skill_data as $s) {
569 // echo "<br>=".ilBasicSkill::lookupLevelSkillId($l["level_id"])."=".$s["skill_id"]."=";
570
571 if ($level_id == 0 && ilBasicSkill::lookupLevelSkillId($l["level_id"]) == $s["skill_id"]) {
572 $level_id = $l["level_id"];
573 $base_skill = $s["skill_id"];
574 $tref_id = $s["tref_id"];
575 }
576 }
577 }
578 if ($level_id > 0) {
579 $prof->addSkillLevel($base_skill, $tref_id, $level_id);
580 }
581 $prof->update();
582 }
583 break;
584 }
585 }
static getCommonSkillIdForImportId($a_source_inst_id, $a_skill_import_id, $a_tref_import_id=0)
Get common skill ids for import IDs (newest first)
static lookupLevelSkillId($a_id)
Lookup level skill id.
static getLevelIdForImportId($a_source_inst_id, $a_level_import_id)
Get level ids for import IDs (newest first)
getCurrentInstallationId()
Get current installation id.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
$type

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

+ Here is the call graph for this function:

◆ readData()

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

Read data.

Parameters

return

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

228 {
230
231 $this->data = array();
232
233 if (!is_array($a_ids)) {
234 $a_ids = array($a_ids);
235 }
236 if ($a_entity == "skmg") { // dummy node
237 switch ($a_version) {
238 case "5.1.0":
239 if ($this->getMode() == self::MODE_SKILLS) {
240 $this->data[] = array("Mode" => "Skills");
241 } elseif ($this->getMode() == self::MODE_PROFILES) {
242 $this->data[] = array("Mode" => "Profiles");
243 }
244 break;
245
246 }
247 }
248 if ($a_entity == "skl_subtree") { // get subtree for top node
249 switch ($a_version) {
250 case "5.1.0":
251 foreach ($a_ids as $id) {
252 $sub = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($id));
253 foreach ($sub as $s) {
254 $set = $ilDB->query(
255 "SELECT * FROM skl_templ_ref " .
256 " WHERE skl_node_id = " . $ilDB->quote($s["child"], "integer")
257 );
258 $rec = $ilDB->fetchAssoc($set);
259
260 $top_node = ($s["child"] == $id)
261 ? 1
262 : 0;
263 $this->data[] = array(
264 "SklTreeId" => $s["skl_tree_id"],
265 "TopNode" => $top_node,
266 "Child" => $s["child"],
267 "Parent" => $s["parent"],
268 "Depth" => $s["depth"],
269 "Type" => $s["type"],
270 "Title" => $s["title"],
271 "Description" => $s["description"],
272 "SelfEval" => $s["self_eval"],
273 "OrderNr" => $s["order_nr"],
274 "Status" => $s["status"],
275 "TemplateId" => (int) $rec["templ_id"]
276 );
277 }
278 }
279 break;
280
281 }
282 }
283
284 if ($a_entity == "skl_templ_subtree") { // get template subtree for template id
285 switch ($a_version) {
286 case "5.1.0":
287 foreach ($a_ids as $id) {
288 $sub = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($id));
289 foreach ($sub as $s) {
290 $top_node = ($s["child"] == $id)
291 ? 1
292 : 0;
293 $this->data[] = array(
294 "SklTreeId" => $s["skl_tree_id"],
295 "TopNode" => $top_node,
296 "Child" => $s["child"],
297 "Parent" => $s["parent"],
298 "Depth" => $s["depth"],
299 "Type" => $s["type"],
300 "Title" => $s["title"],
301 "Description" => $s["description"],
302 "SelfEval" => $s["self_eval"],
303 "OrderNr" => $s["order_nr"],
304 "Status" => $s["status"]
305 );
306 }
307 }
308 break;
309
310 }
311 }
312
313 if ($a_entity == "skl_level") {
314 switch ($a_version) {
315 case "5.1.0":
316 $this->getDirectDataFromQuery("SELECT id level_id, skill_id, nr, title, description" .
317 " FROM skl_level WHERE " .
318 $ilDB->in("skill_id", $a_ids, false, "integer") . " ORDER BY skill_id ASC, nr ASC");
319 break;
320
321 }
322 }
323
324 if ($a_entity == "skl_prof") {
325 switch ($a_version) {
326 case "5.1.0":
327 $this->getDirectDataFromQuery("SELECT id, title, description" .
328 " FROM skl_profile WHERE " .
329 $ilDB->in("id", $a_ids, false, "integer"));
330 break;
331
332 }
333 }
334
335 if ($a_entity == "skl_prof_level") {
336 switch ($a_version) {
337 case "5.1.0":
338 $this->getDirectDataFromQuery("SELECT profile_id, base_skill_id, tref_id, level_id" .
339 " FROM skl_profile_level WHERE " .
340 $ilDB->in("profile_id", $a_ids, false, "integer"));
341 break;
342
343 }
344 }
345 }
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 ...

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

+ Here is the call graph for this function:

◆ setMode()

ilSkillDataSet::setMode (   $a_val)

Set mode.

Parameters
string$a_valmode

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

57 {
58 $this->mode = $a_val;
59 }

◆ setSelectedNodes()

ilSkillDataSet::setSelectedNodes (   $a_val)

Set export selected nodes.

Parameters
array$a_valarray of int

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

77 {
78 $this->selected_nodes = $a_val;
79 }

◆ setSelectedProfiles()

ilSkillDataSet::setSelectedProfiles (   $a_val)

Set selected profiles.

Parameters
array$a_valarray of int (profile ids)

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

97 {
98 $this->selected_profiles = $a_val;
99 }

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: