ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestSkillLevelThresholdList Class Reference
+ Collaboration diagram for ilTestSkillLevelThresholdList:

Public Member Functions

 __construct (ilDB $db)
 setTestId ($testId)
 getTestId ()
 resetThresholds ()
 loadFromDb ()
 getThreshold ($skillBaseId, $skillTrefId, $skillLevelId)

Private Member Functions

 addThreshold ($skillKey, $skillLevelId, $threshold)
 buildSkillLevelThresholdByArray ($data)

Private Attributes

 $db
 $testId
 $thresholds = array()

Detailed Description

Definition at line 12 of file class.ilTestSkillLevelThresholdList.php.

Constructor & Destructor Documentation

ilTestSkillLevelThresholdList::__construct ( ilDB  $db)

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

References $db.

{
$this->db = $db;
}

Member Function Documentation

ilTestSkillLevelThresholdList::addThreshold (   $skillKey,
  $skillLevelId,
  $threshold 
)
private

Definition at line 77 of file class.ilTestSkillLevelThresholdList.php.

Referenced by loadFromDb().

{
$this->thresholds[$skillKey][$skillLevelId] = $threshold;
}

+ Here is the caller graph for this function:

ilTestSkillLevelThresholdList::buildSkillLevelThresholdByArray (   $data)
private

Definition at line 82 of file class.ilTestSkillLevelThresholdList.php.

Referenced by loadFromDb().

{
$threshold = new ilTestSkillLevelThreshold($this->db);
$threshold->setTestId($data['test_fi']);
$threshold->setSkillBaseId($data['skill_base_fi']);
$threshold->setSkillTrefId($data['skill_tref_fi']);
$threshold->setSkillLevelId($data['skill_level_fi']);
$threshold->setThreshold($data['threshold']);
return $threshold;
}

+ Here is the caller graph for this function:

ilTestSkillLevelThresholdList::getTestId ( )
Returns
int

Definition at line 45 of file class.ilTestSkillLevelThresholdList.php.

References $testId.

Referenced by loadFromDb().

{
return $this->testId;
}

+ Here is the caller graph for this function:

ilTestSkillLevelThresholdList::getThreshold (   $skillBaseId,
  $skillTrefId,
  $skillLevelId 
)

Definition at line 95 of file class.ilTestSkillLevelThresholdList.php.

{
$skillKey = $skillBaseId . ':' . $skillTrefId;
if( !isset($this->thresholds[$skillKey]) || !isset($this->thresholds[$skillKey][$skillLevelId]) )
{
return null;
}
return $this->thresholds[$skillKey][$skillLevelId];
}
ilTestSkillLevelThresholdList::loadFromDb ( )

Definition at line 55 of file class.ilTestSkillLevelThresholdList.php.

References $query, $res, $row, addThreshold(), buildSkillLevelThresholdByArray(), getTestId(), and resetThresholds().

{
$this->resetThresholds();
$query = "
SELECT test_fi, skill_base_fi, skill_tref_fi, skill_level_fi, threshold
FROM tst_skl_thresholds
WHERE test_fi = %s
";
$res = $this->db->queryF( $query, array('integer'), array($this->getTestId()) );
while( $row = $this->db->fetchAssoc($res) )
{
$threshold = $this->buildSkillLevelThresholdByArray($row);
$skillKey = $threshold->getSkillBaseId() . ':' . $threshold->getSkillTrefId();
$this->addThreshold($skillKey, $threshold->getSkillLevelId(), $threshold);
}
}

+ Here is the call graph for this function:

ilTestSkillLevelThresholdList::resetThresholds ( )

Definition at line 50 of file class.ilTestSkillLevelThresholdList.php.

Referenced by loadFromDb().

{
$this->thresholds = array();
}

+ Here is the caller graph for this function:

ilTestSkillLevelThresholdList::setTestId (   $testId)
Parameters
int$testId

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

References $testId.

{
$this->testId = $testId;
}

Field Documentation

ilTestSkillLevelThresholdList::$db
private

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

Referenced by __construct().

ilTestSkillLevelThresholdList::$testId
private

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

Referenced by getTestId(), and setTestId().

ilTestSkillLevelThresholdList::$thresholds = array()
private

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


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