ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTestSkillLevelThreshold Class Reference
+ Collaboration diagram for ilTestSkillLevelThreshold:

Public Member Functions

 __construct (ilDBInterface $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

◆ __construct()

ilTestSkillLevelThreshold::__construct ( ilDBInterface  $db)

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

References $db.

44  {
45  $this->db = $db;
46  }

Member Function Documentation

◆ dbRecordExists()

ilTestSkillLevelThreshold::dbRecordExists ( )

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

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

Referenced by saveToDb().

116  {
117  $query = "
118  SELECT COUNT(*) cnt
119  FROM tst_skl_thresholds
120  WHERE test_fi = %s
121  AND skill_base_fi = %s
122  AND skill_tref_fi = %s
123  AND skill_level_fi = %s
124  ";
125 
126  $res = $this->db->queryF(
127  $query, array('integer', 'integer', 'integer', 'integer'),
128  array($this->getTestId(), $this->getSkillBaseId(), $this->getSkillTrefId(), $this->getSkillLevelId())
129  );
130 
131  $row = $this->db->fetchAssoc($res);
132 
133  return $row['cnt'] > 0;
134  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteFromDb()

ilTestSkillLevelThreshold::deleteFromDb ( )

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

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

100  {
101  $query = "
102  DELETE FROM tst_skl_thresholds
103  WHERE test_fi = %s
104  AND skill_base_fi = %s
105  AND skill_tref_fi = %s
106  AND skill_level_fi = %s
107  ";
108 
109  $this->db->manipulateF(
110  $query, array('integer', 'integer', 'integer', 'integer'),
111  array($this->getTestId(), $this->getSkillBaseId(), $this->getSkillTrefId(), $this->getSkillLevelId())
112  );
113  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getSkillBaseId()

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:

◆ getSkillLevelId()

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:

◆ getSkillTrefId()

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:

◆ getTestId()

ilTestSkillLevelThreshold::getTestId ( )
Returns
int

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

References $testId.

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

+ Here is the caller graph for this function:

◆ getThreshold()

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:

◆ loadFromDb()

ilTestSkillLevelThreshold::loadFromDb ( )

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

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

49  {
50  $query = "
51  SELECT test_fi, skill_base_fi, skill_tref_fi, skill_level_fi, threshold
52  FROM tst_skl_thresholds
53  WHERE test_fi = %s
54  AND skill_base_fi = %s
55  AND skill_tref_fi = %s
56  AND skill_level_fi = %s
57  ";
58 
59  $res = $this->db->queryF(
60  $query, array('integer', 'integer', 'integer', 'integer'),
61  array($this->getTestId(), $this->getSkillBaseId(), $this->getSkillTrefId(), $this->getSkillLevelId())
62  );
63 
64  $row = $this->db->fetchAssoc($res);
65 
66  if( is_array($row) )
67  {
68  $this->setThreshold($row['threshold']);
69  }
70  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ saveToDb()

ilTestSkillLevelThreshold::saveToDb ( )

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

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

73  {
74  if( $this->dbRecordExists() )
75  {
76  $this->db->update('tst_skl_thresholds', array(
77  'threshold' => array('integer', $this->getThreshold())
78  ),
79  array(
80  'test_fi' => array('integer', $this->getTestId()),
81  'skill_base_fi' => array('integer', $this->getSkillBaseId()),
82  'skill_tref_fi' => array('integer', $this->getSkillTrefId()),
83  'skill_level_fi' => array('integer', $this->getSkillLevelId())
84  )
85  );
86  }
87  else
88  {
89  $this->db->insert('tst_skl_thresholds', array(
90  'test_fi' => array('integer', $this->getTestId()),
91  'skill_base_fi' => array('integer', $this->getSkillBaseId()),
92  'skill_tref_fi' => array('integer', $this->getSkillTrefId()),
93  'skill_level_fi' => array('integer', $this->getSkillLevelId()),
94  'threshold' => array('integer', $this->getThreshold())
95  ));
96  }
97  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ setSkillBaseId()

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

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

References $skillBaseId.

156  {
157  $this->skillBaseId = $skillBaseId;
158  }

◆ setSkillLevelId()

ilTestSkillLevelThreshold::setSkillLevelId (   $skillLevelId)
Parameters
int$skillLevelId

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

References $skillLevelId.

188  {
189  $this->skillLevelId = $skillLevelId;
190  }

◆ setSkillTrefId()

ilTestSkillLevelThreshold::setSkillTrefId (   $skillTrefId)
Parameters
int$skillTrefId

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

References $skillTrefId.

172  {
173  $this->skillTrefId = $skillTrefId;
174  }

◆ setTestId()

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

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

References $testId.

140  {
141  $this->testId = $testId;
142  }

◆ setThreshold()

ilTestSkillLevelThreshold::setThreshold (   $threshold)
Parameters
int$threshold

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

References $threshold.

Referenced by loadFromDb().

204  {
205  $this->threshold = $threshold;
206  }
+ Here is the caller graph for this function:

Field Documentation

◆ $db

ilTestSkillLevelThreshold::$db
private

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

Referenced by __construct().

◆ $skillBaseId

ilTestSkillLevelThreshold::$skillBaseId
private

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

Referenced by getSkillBaseId(), and setSkillBaseId().

◆ $skillLevelId

ilTestSkillLevelThreshold::$skillLevelId
private

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

Referenced by getSkillLevelId(), and setSkillLevelId().

◆ $skillTrefId

ilTestSkillLevelThreshold::$skillTrefId
private

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

Referenced by getSkillTrefId(), and setSkillTrefId().

◆ $testId

ilTestSkillLevelThreshold::$testId
private

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

Referenced by getTestId(), and setTestId().

◆ $threshold

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: