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

Public Member Functions

 __construct (ilDB $db)
 loadFromDb ()
 saveToDb ()
 deleteFromDb ()
 dbRecordExists ()
 setTestId ($testId)
 getTestId ()
 setSkillBaseId ($skillBaseId)
 getSkillBaseId ()
 setSkillTrefId ($skillTrefId)
 getSkillTrefId ()
 setSkillLevelId ($skillLevelId)
 getSkillLevelId ()
 setThreshold ($threshold)
 getThreshold ()

Private Attributes

 $db
 $testId
 $skillBaseId
 $skillTrefId
 $skillLevelId
 $threshold

Detailed Description

Definition at line 11 of file class.ilTestSkillLevelThreshold.php.

Constructor & Destructor Documentation

ilTestSkillLevelThreshold::__construct ( ilDB  $db)

Definition at line 43 of file class.ilTestSkillLevelThreshold.php.

References $db.

{
$this->db = $db;
}

Member Function Documentation

ilTestSkillLevelThreshold::dbRecordExists ( )

Definition at line 115 of file class.ilTestSkillLevelThreshold.php.

References $query, $res, $row, getSkillBaseId(), getSkillLevelId(), getSkillTrefId(), and getTestId().

Referenced by saveToDb().

{
$query = "
SELECT COUNT(*) cnt
FROM tst_skl_thresholds
WHERE test_fi = %s
AND skill_base_fi = %s
AND skill_tref_fi = %s
AND skill_level_fi = %s
";
$res = $this->db->queryF(
$query, array('integer', 'integer', 'integer', 'integer'),
array($this->getTestId(), $this->getSkillBaseId(), $this->getSkillTrefId(), $this->getSkillLevelId())
);
$row = $this->db->fetchAssoc($res);
return $row['cnt'] > 0;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestSkillLevelThreshold::deleteFromDb ( )

Definition at line 99 of file class.ilTestSkillLevelThreshold.php.

References $query, getSkillBaseId(), getSkillLevelId(), getSkillTrefId(), and getTestId().

{
$query = "
DELETE FROM tst_skl_thresholds
WHERE test_fi = %s
AND skill_base_fi = %s
AND skill_tref_fi = %s
AND skill_level_fi = %s
";
$this->db->manipulateF(
$query, array('integer', 'integer', 'integer', 'integer'),
array($this->getTestId(), $this->getSkillBaseId(), $this->getSkillTrefId(), $this->getSkillLevelId())
);
}

+ Here is the call graph for this function:

ilTestSkillLevelThreshold::getSkillBaseId ( )
Returns
int

Definition at line 163 of file class.ilTestSkillLevelThreshold.php.

References $skillBaseId.

Referenced by dbRecordExists(), deleteFromDb(), loadFromDb(), and saveToDb().

{
}

+ Here is the caller graph for this function:

ilTestSkillLevelThreshold::getSkillLevelId ( )
Returns
int

Definition at line 195 of file class.ilTestSkillLevelThreshold.php.

References $skillLevelId.

Referenced by dbRecordExists(), deleteFromDb(), loadFromDb(), and saveToDb().

{
}

+ Here is the caller graph for this function:

ilTestSkillLevelThreshold::getSkillTrefId ( )
Returns
int

Definition at line 179 of file class.ilTestSkillLevelThreshold.php.

References $skillTrefId.

Referenced by dbRecordExists(), deleteFromDb(), loadFromDb(), and saveToDb().

{
}

+ Here is the caller graph for this function:

ilTestSkillLevelThreshold::getTestId ( )
Returns
int

Definition at line 147 of file class.ilTestSkillLevelThreshold.php.

References $testId.

Referenced by dbRecordExists(), deleteFromDb(), loadFromDb(), and saveToDb().

{
return $this->testId;
}

+ Here is the caller graph for this function:

ilTestSkillLevelThreshold::getThreshold ( )
Returns
int

Definition at line 211 of file class.ilTestSkillLevelThreshold.php.

References $threshold.

Referenced by saveToDb().

{
}

+ Here is the caller graph for this function:

ilTestSkillLevelThreshold::loadFromDb ( )

Definition at line 48 of file class.ilTestSkillLevelThreshold.php.

References $query, $res, $row, getSkillBaseId(), getSkillLevelId(), getSkillTrefId(), getTestId(), and setThreshold().

{
$query = "
SELECT test_fi, skill_base_fi, skill_tref_fi, skill_level_fi, threshold
FROM tst_skl_thresholds
WHERE test_fi = %s
AND skill_base_fi = %s
AND skill_tref_fi = %s
AND skill_level_fi = %s
";
$res = $this->db->queryF(
$query, array('integer', 'integer', 'integer', 'integer'),
array($this->getTestId(), $this->getSkillBaseId(), $this->getSkillTrefId(), $this->getSkillLevelId())
);
$row = $this->db->fetchAssoc($res);
if( is_array($row) )
{
$this->setThreshold($row['threshold']);
}
}

+ Here is the call graph for this function:

ilTestSkillLevelThreshold::saveToDb ( )

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

References dbRecordExists(), getSkillBaseId(), getSkillLevelId(), getSkillTrefId(), getTestId(), and getThreshold().

{
if( $this->dbRecordExists() )
{
$this->db->update('tst_skl_thresholds', array(
'threshold' => array('integer', $this->getThreshold())
),
array(
'test_fi' => array('integer', $this->getTestId()),
'skill_base_fi' => array('integer', $this->getSkillBaseId()),
'skill_tref_fi' => array('integer', $this->getSkillTrefId()),
'skill_level_fi' => array('integer', $this->getSkillLevelId())
)
);
}
else
{
$this->db->insert('tst_skl_thresholds', array(
'test_fi' => array('integer', $this->getTestId()),
'skill_base_fi' => array('integer', $this->getSkillBaseId()),
'skill_tref_fi' => array('integer', $this->getSkillTrefId()),
'skill_level_fi' => array('integer', $this->getSkillLevelId()),
'threshold' => array('integer', $this->getThreshold())
));
}
}

+ Here is the call graph for this function:

ilTestSkillLevelThreshold::setSkillBaseId (   $skillBaseId)
Parameters
int$skillBaseId

Definition at line 155 of file class.ilTestSkillLevelThreshold.php.

References $skillBaseId.

{
$this->skillBaseId = $skillBaseId;
}
ilTestSkillLevelThreshold::setSkillLevelId (   $skillLevelId)
Parameters
int$skillLevelId

Definition at line 187 of file class.ilTestSkillLevelThreshold.php.

References $skillLevelId.

{
$this->skillLevelId = $skillLevelId;
}
ilTestSkillLevelThreshold::setSkillTrefId (   $skillTrefId)
Parameters
int$skillTrefId

Definition at line 171 of file class.ilTestSkillLevelThreshold.php.

References $skillTrefId.

{
$this->skillTrefId = $skillTrefId;
}
ilTestSkillLevelThreshold::setTestId (   $testId)
Parameters
int$testId

Definition at line 139 of file class.ilTestSkillLevelThreshold.php.

References $testId.

{
$this->testId = $testId;
}
ilTestSkillLevelThreshold::setThreshold (   $threshold)
Parameters
int$threshold

Definition at line 203 of file class.ilTestSkillLevelThreshold.php.

References $threshold.

Referenced by loadFromDb().

{
$this->threshold = $threshold;
}

+ Here is the caller graph for this function:

Field Documentation

ilTestSkillLevelThreshold::$db
private

Definition at line 16 of file class.ilTestSkillLevelThreshold.php.

Referenced by __construct().

ilTestSkillLevelThreshold::$skillBaseId
private

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

Referenced by getSkillBaseId(), and setSkillBaseId().

ilTestSkillLevelThreshold::$skillLevelId
private

Definition at line 36 of file class.ilTestSkillLevelThreshold.php.

Referenced by getSkillLevelId(), and setSkillLevelId().

ilTestSkillLevelThreshold::$skillTrefId
private

Definition at line 31 of file class.ilTestSkillLevelThreshold.php.

Referenced by getSkillTrefId(), and setSkillTrefId().

ilTestSkillLevelThreshold::$testId
private

Definition at line 21 of file class.ilTestSkillLevelThreshold.php.

Referenced by getTestId(), and setTestId().

ilTestSkillLevelThreshold::$threshold
private

Definition at line 41 of file class.ilTestSkillLevelThreshold.php.

Referenced by getThreshold(), and setThreshold().


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