ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilTestSkillLevelThresholdImportList.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
11 {
12  protected $originalSkillTitles = array();
13  protected $originalSkillPaths = array();
14  protected $importedSkillLevelThresholds = array();
15 
16  public function addOriginalSkillTitle($skillBaseId, $skillTrefId, $originalSkillTitle)
17  {
18  $this->originalSkillTitles["{$skillBaseId}:{$skillTrefId}"] = $originalSkillTitle;
19  }
20 
21  public function addOriginalSkillPath($skillBaseId, $skillTrefId, $originalSkillPath)
22  {
23  $this->originalSkillPaths["{$skillBaseId}:{$skillTrefId}"] = $originalSkillPath;
24  }
25 
26  public function addSkillLevelThreshold(ilTestSkillLevelThresholdImport $importedSkillLevelThreshold)
27  {
28  $this->importedSkillLevelThresholds[] = $importedSkillLevelThreshold;
29  }
30 
31  public function getThresholdsByImportSkill($importSkillBaseId, $importSkillTrefId)
32  {
33  $thresholds = array();
34 
35  foreach ($this as $skillLevelThreshold) {
36  if ($skillLevelThreshold->getImportSkillBaseId() != $importSkillBaseId) {
37  continue;
38  }
39 
40  if ($skillLevelThreshold->getImportSkillTrefId() != $importSkillTrefId) {
41  continue;
42  }
43 
44  $thresholds[] = $skillLevelThreshold;
45  }
46 
47  return $thresholds;
48  }
49 
53  public function current()
54  {
55  return current($this->importedSkillLevelThresholds);
56  }
57 
61  public function next()
62  {
63  return next($this->importedSkillLevelThresholds);
64  }
65 
69  public function key()
70  {
71  return key($this->importedSkillLevelThresholds);
72  }
73 
77  public function valid()
78  {
79  return key($this->importedSkillLevelThresholds) !== null;
80  }
81 
85  public function rewind()
86  {
87  return reset($this->importedSkillLevelThresholds);
88  }
89 }
addOriginalSkillTitle($skillBaseId, $skillTrefId, $originalSkillTitle)
getThresholdsByImportSkill($importSkillBaseId, $importSkillTrefId)
addSkillLevelThreshold(ilTestSkillLevelThresholdImport $importedSkillLevelThreshold)
addOriginalSkillPath($skillBaseId, $skillTrefId, $originalSkillPath)