ILIAS  release_8 Revision v8.24
class.ilTestSkillLevelThresholdImportList.php
Go to the documentation of this file.
1<?php
2
25class ilTestSkillLevelThresholdImportList implements Iterator
26{
27 protected $originalSkillTitles = array();
28 protected $originalSkillPaths = array();
29 protected $importedSkillLevelThresholds = array();
30
31 public function addOriginalSkillTitle($skillBaseId, $skillTrefId, $originalSkillTitle)
32 {
33 $this->originalSkillTitles["{$skillBaseId}:{$skillTrefId}"] = $originalSkillTitle;
34 }
35
36 public function addOriginalSkillPath($skillBaseId, $skillTrefId, $originalSkillPath)
37 {
38 $this->originalSkillPaths["{$skillBaseId}:{$skillTrefId}"] = $originalSkillPath;
39 }
40
41 public function addSkillLevelThreshold(ilTestSkillLevelThresholdImport $importedSkillLevelThreshold)
42 {
43 $this->importedSkillLevelThresholds[] = $importedSkillLevelThreshold;
44 }
45
46 public function getThresholdsByImportSkill($importSkillBaseId, $importSkillTrefId): array
47 {
48 $thresholds = array();
49
50 foreach ($this as $skillLevelThreshold) {
51 if ($skillLevelThreshold->getImportSkillBaseId() != $importSkillBaseId) {
52 continue;
53 }
54
55 if ($skillLevelThreshold->getImportSkillTrefId() != $importSkillTrefId) {
56 continue;
57 }
58
59 $thresholds[] = $skillLevelThreshold;
60 }
61
62 return $thresholds;
63 }
64
69 {
70 return current($this->importedSkillLevelThresholds);
71 }
72
73 public function next()
74 {
75 return next($this->importedSkillLevelThresholds);
76 }
77
81 public function key()
82 {
83 return key($this->importedSkillLevelThresholds);
84 }
85
89 public function valid(): bool
90 {
91 return key($this->importedSkillLevelThresholds) !== null;
92 }
93
97 public function rewind()
98 {
99 return reset($this->importedSkillLevelThresholds);
100 }
101}
addOriginalSkillPath($skillBaseId, $skillTrefId, $originalSkillPath)
addSkillLevelThreshold(ilTestSkillLevelThresholdImport $importedSkillLevelThreshold)
addOriginalSkillTitle($skillBaseId, $skillTrefId, $originalSkillTitle)
getThresholdsByImportSkill($importSkillBaseId, $importSkillTrefId)