ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 
 stripTags (array $rec, array $omit_keys=[])
 

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
 
 $ds_namespace = 'ds'
 

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

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillDataSet::__construct ( )

Constructor.

Reimplemented from ilDataSet.

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

35 {
36 global $DIC;
37
38 $this->db = $DIC->database();
40 $this->skill_tree = new ilSkillTree();
41 $this->skill_tree_root_id = $this->skill_tree->readRootId();
42
43 $this->init_top_order_nr = $this->skill_tree->getMaxOrderNr($this->skill_tree_root_id);
44 $this->init_templ_top_order_nr = $this->skill_tree->getMaxOrderNr($this->skill_tree_root_id, true);
45 }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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 407 of file class.ilSkillDataSet.php.

408 {
410
411 switch ($a_entity) {
412 case "skmg":
413
414 if ($this->getMode() == self::MODE_SKILLS) {
415 // determine top nodes of main tree to be exported and all referenced template nodes
416 $sel_nodes = $this->getSelectedNodes();
417 $exp_types = array("skll", "scat", "sctr", "sktr");
418 if (!is_array($sel_nodes)) {
419 $childs = $this->skill_tree->getChildsByTypeFilter($this->skill_tree->readRootId(), $exp_types);
420 $deps = array();
421 $skl_subtree_deps = array();
422 foreach ($childs as $c) {
423 $skl_subtree_deps[] = $c["child"];
424 }
425 } else {
426 foreach ($sel_nodes as $n) {
427 if (in_array(ilSkillTreeNode::_lookupType((int) $n), $exp_types)) {
428 $skl_subtree_deps[] = $n;
429 }
430 }
431 }
432
433 // determine template subtrees
434 $ref_nodes = array();
435 if (is_array($skl_subtree_deps)) {
436 foreach ($skl_subtree_deps as $id) {
437 if (ilSkillTreeNode::_lookupType($id) == "sktr") {
438 $ref_nodes[$id] = $id;
439 } else {
440 $sub = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($id), true, "sktr");
441 foreach ($sub as $s) {
442 $ref_nodes[$s["child"]] = $s["child"];
443 }
444 }
445 }
446 }
447
448 $set = $ilDB->query("SELECT DISTINCT(templ_id) FROM skl_templ_ref " .
449 " WHERE " . $ilDB->in("skl_node_id", $ref_nodes, false, "integer"));
450 while ($rec = $ilDB->fetchAssoc($set)) {
451 $deps["skl_templ_subtree"]["ids"][] = $rec["templ_id"];
452 }
453
454 // export subtree after templates
455 $deps["skl_subtree"]["ids"] = $skl_subtree_deps;
456 } elseif ($this->getMode() == self::MODE_PROFILES) {
457 foreach ($this->getSelectedProfiles() as $p_id) {
458 $deps["skl_prof"]["ids"][] = $p_id;
459 }
460 }
461
462 return $deps;
463
464 case "skl_subtree":
465 case "skl_templ_subtree":
466 $deps = array();
467 if (in_array($a_rec["Type"], array("skll", "sktp"))) {
468 $deps["skl_level"]["ids"][] = $a_rec["Child"];
469 }
470 return $deps;
471
472 case "skl_prof":
473 case "skl_local_prof":
474 $deps["skl_prof_level"]["ids"][] = $a_rec["Id"];
475 return $deps;
476 }
477
478 return false;
479 }
$n
Definition: RandomTest.php:85
getSelectedNodes()
Get export selected nodes.
getSelectedProfiles()
Get selected profiles.
static _lookupType($a_obj_id)
Lookup Type.
$c
Definition: cli.php:37
global $ilDB

References $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 62 of file class.ilSkillDataSet.php.

63 {
64 return $this->mode;
65 }

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 82 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 102 of file class.ilSkillDataSet.php.

103 {
105 }

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 112 of file class.ilSkillDataSet.php.

113 {
114 return array("5.1.0", "7.0");
115 }

◆ getTypes()

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

Get field types for entity.

Parameters

return

Reimplemented from ilDataSet.

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

135 {
136 if ($a_entity == "skmg") {
137 switch ($a_version) {
138 case "5.1.0":
139 case "7.0":
140 return array(
141 "Mode" => "text"
142 );
143 }
144 }
145 if ($a_entity == "skl_subtree") {
146 switch ($a_version) {
147 case "5.1.0":
148 case "7.0":
149 return array(
150 "SklTreeId" => "integer",
151 "TopNode" => "integer",
152 "Child" => "integer",
153 "Parent" => "integer",
154 "Depth" => "integer",
155 "Type" => "text",
156 "Title" => "text",
157 "Description" => "text",
158 "SelfEval" => "integer",
159 "OrderNr" => "integer",
160 "Status" => "integer",
161 "TemplateId" => "integer"
162 );
163 }
164 }
165 if ($a_entity == "skl_templ_subtree") {
166 switch ($a_version) {
167 case "5.1.0":
168 case "7.0":
169 return array(
170 "SklTreeId" => "integer",
171 "TopNode" => "integer",
172 "Child" => "integer",
173 "Parent" => "integer",
174 "Depth" => "integer",
175 "Type" => "text",
176 "Title" => "text",
177 "Description" => "text",
178 "SelfEval" => "integer",
179 "OrderNr" => "integer",
180 "Status" => "integer"
181 );
182 }
183 }
184 if ($a_entity == "skl_level") {
185 switch ($a_version) {
186 case "5.1.0":
187 case "7.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 case "7.0":
201 return array(
202 "Id" => "integer",
203 "Title" => "text",
204 "Description" => "text"
205 );
206 }
207 }
208 if ($a_entity == "skl_local_prof") {
209 switch ($a_version) {
210 case "7.0":
211 return array(
212 "Id" => "integer",
213 "Title" => "text",
214 "Description" => "text",
215 "RefId" => "integer"
216 );
217 }
218 }
219 if ($a_entity == "skl_prof_level") {
220 switch ($a_version) {
221 case "5.1.0":
222 return array(
223 "ProfileId" => "integer",
224 "BaseSkillId" => "integer",
225 "TrefId" => "integer",
226 "LevelId" => "integer"
227 );
228 case "7.0":
229 return array(
230 "ProfileId" => "integer",
231 "BaseSkillId" => "integer",
232 "TrefId" => "integer",
233 "LevelId" => "integer",
234 "OrderNr" => "integer"
235 );
236 }
237 }
238 return array();
239 }

◆ getXmlNamespace()

ilSkillDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

return

Reimplemented from ilDataSet.

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

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

◆ importRecord()

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

Import record.

Parameters

return

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

489 {
490 $source_inst_id = $a_mapping->getInstallId();
491 switch ($a_entity) {
492 case "skl_subtree":
493 if ($a_rec["TopNode"] == 1) {
494 $parent = $this->skill_tree_root_id;
496 $order = $a_rec["OrderNr"] + $this->init_top_order_nr;
497 } else {
498 $parent = (int) $a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["Parent"]);
499 $status = $a_rec["Status"];
500 $order = $a_rec["OrderNr"];
501 }
502 switch ($a_rec["Type"]) {
503 case "scat":
504 $scat = new ilSkillCategory();
505 $scat->setTitle($a_rec["Title"]);
506 $scat->setDescription($a_rec["Description"]);
507 $scat->setImportId("il_" . $source_inst_id . "_scat_" . $a_rec["Child"]);
508 $scat->setSelfEvaluation($a_rec["SelfEval"]);
509 $scat->setOrderNr($order);
510 $scat->setStatus($status);
511 $scat->create();
512 ilSkillTreeNode::putInTree($scat, $parent);
513 $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $scat->getId());
514 break;
515
516 case "skll":
517 $skll = new ilBasicSkill();
518 $skll->setTitle($a_rec["Title"]);
519 $skll->setDescription($a_rec["Description"]);
520 $skll->setImportId("il_" . $source_inst_id . "_skll_" . $a_rec["Child"]);
521 $skll->setSelfEvaluation($a_rec["SelfEval"]);
522 $skll->setOrderNr($order);
523 $skll->setStatus($status);
524 $skll->create();
525 ilSkillTreeNode::putInTree($skll, $parent);
526 $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $skll->getId());
527 break;
528
529 case "sktr":
530 $template_id = (int) $a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["TemplateId"]);
531 // only create template references, if referenced template is found (template trees are imported first)
532 if ($template_id > 0) {
533 $sktr = new ilSkillTemplateReference();
534 $sktr->setTitle($a_rec["Title"]);
535 $sktr->setDescription($a_rec["Description"]);
536 $sktr->setImportId("il_" . $source_inst_id . "_sktr_" . $a_rec["Child"]);
537 $sktr->setSelfEvaluation($a_rec["SelfEval"]);
538 $sktr->setOrderNr($order);
539 $sktr->setSkillTemplateId($template_id);
540 $sktr->setStatus($status);
541 $sktr->create();
542 ilSkillTreeNode::putInTree($sktr, $parent);
543 $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $sktr->getId());
544 }
545 break;
546
547 }
548 break;
549
550 case "skl_templ_subtree":
551 if ($a_rec["TopNode"] == 1) {
552 $parent = $this->skill_tree_root_id;
553 $order = $a_rec["OrderNr"] + $this->init_templ_top_order_nr;
554 } else {
555 $parent = (int) $a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["Parent"]);
556 $order = $a_rec["OrderNr"];
557 }
558 switch ($a_rec["Type"]) {
559 case "sctp":
560 $sctp = new ilSkillTemplateCategory();
561 $sctp->setTitle($a_rec["Title"]);
562 $sctp->setDescription($a_rec["Description"]);
563 $sctp->setImportId("il_" . $source_inst_id . "_sctp_" . $a_rec["Child"]);
564 $sctp->setOrderNr($order);
565 $sctp->create();
566 ilSkillTreeNode::putInTree($sctp, $parent);
567 $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $sctp->getId());
568 break;
569
570 case "sktp":
571 $sktp = new ilBasicSkillTemplate();
572 $sktp->setTitle($a_rec["Title"]);
573 $sktp->setDescription($a_rec["Description"]);
574 $sktp->setImportId("il_" . $source_inst_id . "_sktp_" . $a_rec["Child"]);
575 $sktp->setOrderNr($order);
576 $sktp->create();
577 ilSkillTreeNode::putInTree($sktp, $parent);
578 $a_mapping->addMapping("Services/Skill", "skl_tree", $a_rec["Child"], $sktp->getId());
579 break;
580 }
581 break;
582
583 case "skl_level":
584 $skill_id = (int) $a_mapping->getMapping("Services/Skill", "skl_tree", $a_rec["SkillId"]);
586 if (in_array($type, array("skll", "sktp"))) {
587 if ($type == "skll") {
588 $skill = new ilBasicSkill($skill_id);
589 } else {
590 $skill = new ilBasicSkillTemplate($skill_id);
591 }
592 $skill->addLevel($a_rec["Title"], $a_rec["Description"], "il_" . $source_inst_id . "_sklv_" . $a_rec["LevelId"]);
593 $skill->update();
594 }
595 break;
596
597 case "skl_prof":
598 $prof = new ilSkillProfile();
599 $prof->setTitle($a_rec["Title"]);
600 $prof->setDescription($a_rec["Description"]);
601 $prof->create();
602 $a_mapping->addMapping("Services/Skill", "skl_prof", $a_rec["Id"], $prof->getId());
603 break;
604
605 case "skl_local_prof":
606 $prof = new ilSkillProfile();
607 $prof->setTitle($a_rec["Title"]);
608 $prof->setDescription($a_rec["Description"]);
609 $prof->setRefId($a_rec["RefId"]);
610 $prof->create();
611 $a_mapping->addMapping("Services/Skill", "skl_local_prof", $a_rec["Id"], $prof->getId());
612 break;
613
614 case "skl_prof_level":
615 $profile_id = (int) $a_mapping->getMapping("Services/Skill", "skl_prof", $a_rec["ProfileId"])
616 ? (int) $a_mapping->getMapping("Services/Skill", "skl_prof", $a_rec["ProfileId"])
617 : (int) $a_mapping->getMapping("Services/Skill", "skl_local_prof", $a_rec["ProfileId"]);
618 if ($profile_id > 0) {
619 $prof = new ilSkillProfile($profile_id);
620 $level_id_data = ilBasicSkill::getLevelIdForImportId($this->getCurrentInstallationId(), $a_rec["LevelId"]);
621 $skill_data = ilBasicSkill::getCommonSkillIdForImportId($this->getCurrentInstallationId(), $a_rec["BaseSkillId"], $a_rec["TrefId"]);
622 //var_dump($level_id_data);
623 //var_dump($skill_data);
624 $level_id = $tref_id = $base_skill = 0;
625 foreach ($level_id_data as $l) {
626 reset($skill_data);
627 foreach ($skill_data as $s) {
628 // echo "<br>=".ilBasicSkill::lookupLevelSkillId($l["level_id"])."=".$s["skill_id"]."=";
629
630 if ($level_id == 0 && ilBasicSkill::lookupLevelSkillId($l["level_id"]) == $s["skill_id"]) {
631 $level_id = $l["level_id"];
632 $base_skill = $s["skill_id"];
633 $tref_id = $s["tref_id"];
634 }
635 }
636 }
637 if ($level_id > 0) {
638 $prof->addSkillLevel($base_skill, $tref_id, $level_id, $a_rec["OrderNr"]);
639 }
640 $prof->update();
641 }
642 break;
643 }
644 }
static lookupLevelSkillId(int $a_id)
static getCommonSkillIdForImportId(int $a_source_inst_id, int $a_skill_import_id, int $a_tref_import_id=0)
static getLevelIdForImportId(int $a_source_inst_id, int $a_level_import_id)
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 247 of file class.ilSkillDataSet.php.

248 {
250
251 $this->data = array();
252
253 if (!is_array($a_ids)) {
254 $a_ids = array($a_ids);
255 }
256 if ($a_entity == "skmg") { // dummy node
257 switch ($a_version) {
258 case "5.1.0":
259 case "7.0":
260 if ($this->getMode() == self::MODE_SKILLS) {
261 $this->data[] = array("Mode" => "Skills");
262 } elseif ($this->getMode() == self::MODE_PROFILES) {
263 $this->data[] = array("Mode" => "Profiles");
264 }
265 break;
266
267 }
268 }
269 if ($a_entity == "skl_subtree") { // get subtree for top node
270 switch ($a_version) {
271 case "5.1.0":
272 case "7.0":
273 foreach ($a_ids as $id) {
274 $sub = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($id));
275 foreach ($sub as $s) {
276 $set = $ilDB->query(
277 "SELECT * FROM skl_templ_ref " .
278 " WHERE skl_node_id = " . $ilDB->quote($s["child"], "integer")
279 );
280 $rec = $ilDB->fetchAssoc($set);
281
282 $top_node = ($s["child"] == $id)
283 ? 1
284 : 0;
285 $this->data[] = array(
286 "SklTreeId" => $s["skl_tree_id"],
287 "TopNode" => $top_node,
288 "Child" => $s["child"],
289 "Parent" => $s["parent"],
290 "Depth" => $s["depth"],
291 "Type" => $s["type"],
292 "Title" => $s["title"],
293 "Description" => $s["description"],
294 "SelfEval" => $s["self_eval"],
295 "OrderNr" => $s["order_nr"],
296 "Status" => $s["status"],
297 "TemplateId" => (int) $rec["templ_id"]
298 );
299 }
300 }
301 break;
302
303 }
304 }
305
306 if ($a_entity == "skl_templ_subtree") { // get template subtree for template id
307 switch ($a_version) {
308 case "5.1.0":
309 case "7.0":
310 foreach ($a_ids as $id) {
311 $sub = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($id));
312 foreach ($sub as $s) {
313 $top_node = ($s["child"] == $id)
314 ? 1
315 : 0;
316 $this->data[] = array(
317 "SklTreeId" => $s["skl_tree_id"],
318 "TopNode" => $top_node,
319 "Child" => $s["child"],
320 "Parent" => $s["parent"],
321 "Depth" => $s["depth"],
322 "Type" => $s["type"],
323 "Title" => $s["title"],
324 "Description" => $s["description"],
325 "SelfEval" => $s["self_eval"],
326 "OrderNr" => $s["order_nr"],
327 "Status" => $s["status"]
328 );
329 }
330 }
331 break;
332
333 }
334 }
335
336 if ($a_entity == "skl_level") {
337 switch ($a_version) {
338 case "5.1.0":
339 case "7.0":
340 $this->getDirectDataFromQuery("SELECT id level_id, skill_id, nr, title, description" .
341 " FROM skl_level WHERE " .
342 $ilDB->in("skill_id", $a_ids, false, "integer") . " ORDER BY skill_id ASC, nr ASC");
343 break;
344
345 }
346 }
347
348 if ($a_entity == "skl_prof") {
349 switch ($a_version) {
350 case "5.1.0":
351 case "7.0":
352 $this->getDirectDataFromQuery("SELECT id, title, description" .
353 " FROM skl_profile WHERE " .
354 $ilDB->in("id", $a_ids, false, "integer"));
355 break;
356
357 }
358 }
359
360 if ($a_entity == "skl_local_prof") {
361 switch ($a_version) {
362 case "7.0":
363 foreach ($a_ids as $obj_id) {
364 $obj_ref_id = ilObject::_getAllReferences($obj_id);
365 $obj_ref_id = end($obj_ref_id);
366 $profiles = ilSkillProfile::getLocalProfiles($obj_ref_id);
367 foreach ($profiles as $p) {
368 $profile_ids[] = $p["id"];
369 }
370 $set = $ilDB->query(
371 "SELECT * FROM skl_profile " .
372 " WHERE ". $ilDB->in("id", $profile_ids, false, "integer")
373 );
374 while ($rec = $ilDB->fetchAssoc($set)) {
375 $this->data[] = [
376 "Id" => $rec["id"],
377 "Title" => $rec["title"],
378 "Description" => $rec["description"],
379 "RefId" => $obj_ref_id
380 ];
381 }
382 }
383 break;
384
385 }
386 }
387
388 if ($a_entity == "skl_prof_level") {
389 switch ($a_version) {
390 case "5.1.0":
391 $this->getDirectDataFromQuery("SELECT profile_id, base_skill_id, tref_id, level_id" .
392 " FROM skl_profile_level WHERE " .
393 $ilDB->in("profile_id", $a_ids, false, "integer"));
394 break;
395 case "7.0":
396 $this->getDirectDataFromQuery("SELECT profile_id, base_skill_id, tref_id, level_id, order_nr" .
397 " FROM skl_profile_level WHERE " .
398 $ilDB->in("profile_id", $a_ids, false, "integer"));
399 break;
400 }
401 }
402 }
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 ...
static _getAllReferences($a_id)
get all reference ids of object
static getLocalProfiles(int $a_ref_id)
Get local profiles of object.

References ilDataSet\$db, $ilDB, ilObject\_getAllReferences(), ilDataSet\getDirectDataFromQuery(), ilSkillProfile\getLocalProfiles(), and getMode().

+ Here is the call graph for this function:

◆ setMode()

ilSkillDataSet::setMode (   $a_val)

Set mode.

Parameters
string$a_valmode

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

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

◆ setSelectedNodes()

ilSkillDataSet::setSelectedNodes (   $a_val)

Set export selected nodes.

Parameters
array$a_valarray of int

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

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

◆ setSelectedProfiles()

ilSkillDataSet::setSelectedProfiles (   $a_val)

Set selected profiles.

Parameters
array$a_valarray of int (profile ids)

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

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

Field Documentation

◆ $init_order_nr

ilSkillDataSet::$init_order_nr
protected

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

◆ $mode

ilSkillDataSet::$mode = ""
protected

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

Referenced by getMode().

◆ $selected_nodes

ilSkillDataSet::$selected_nodes = false
protected

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

Referenced by getSelectedNodes().

◆ $selected_profiles

ilSkillDataSet::$selected_profiles = false
protected

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

Referenced by getSelectedProfiles().

◆ $skill_tree

ilSkillDataSet::$skill_tree
protected

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

◆ MODE_PROFILES

const ilSkillDataSet::MODE_PROFILES = "prof"

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

◆ MODE_SKILLS

const ilSkillDataSet::MODE_SKILLS = ""

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


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