ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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,
128  array('integer', 'integer', 'integer', 'integer'),
129  array($this->getTestId(), $this->getSkillBaseId(), $this->getSkillTrefId(), $this->getSkillLevelId())
130  );
131 
132  $row = $this->db->fetchAssoc($res);
133 
134  return $row['cnt'] > 0;
135  }
foreach($_POST as $key=> $value) $res
$query
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 98 of file class.ilTestSkillLevelThreshold.php.

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

99  {
100  $query = "
101  DELETE FROM tst_skl_thresholds
102  WHERE test_fi = %s
103  AND skill_base_fi = %s
104  AND skill_tref_fi = %s
105  AND skill_level_fi = %s
106  ";
107 
108  $this->db->manipulateF(
109  $query,
110  array('integer', 'integer', 'integer', 'integer'),
111  array($this->getTestId(), $this->getSkillBaseId(), $this->getSkillTrefId(), $this->getSkillLevelId())
112  );
113  }
$query
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 164 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 196 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 180 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 148 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 212 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,
61  array('integer', 'integer', 'integer', 'integer'),
62  array($this->getTestId(), $this->getSkillBaseId(), $this->getSkillTrefId(), $this->getSkillLevelId())
63  );
64 
65  $row = $this->db->fetchAssoc($res);
66 
67  if (is_array($row)) {
68  $this->setThreshold($row['threshold']);
69  }
70  }
foreach($_POST as $key=> $value) $res
$query
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  $this->db->update(
76  'tst_skl_thresholds',
77  array(
78  'threshold' => array('integer', $this->getThreshold())
79  ),
80  array(
81  'test_fi' => array('integer', $this->getTestId()),
82  'skill_base_fi' => array('integer', $this->getSkillBaseId()),
83  'skill_tref_fi' => array('integer', $this->getSkillTrefId()),
84  'skill_level_fi' => array('integer', $this->getSkillLevelId())
85  )
86  );
87  } else {
88  $this->db->insert('tst_skl_thresholds', array(
89  'test_fi' => array('integer', $this->getTestId()),
90  'skill_base_fi' => array('integer', $this->getSkillBaseId()),
91  'skill_tref_fi' => array('integer', $this->getSkillTrefId()),
92  'skill_level_fi' => array('integer', $this->getSkillLevelId()),
93  'threshold' => array('integer', $this->getThreshold())
94  ));
95  }
96  }
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 156 of file class.ilTestSkillLevelThreshold.php.

References $skillBaseId.

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

◆ setSkillLevelId()

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

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

References $skillLevelId.

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

◆ setSkillTrefId()

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

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

References $skillTrefId.

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

◆ setTestId()

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

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

References $testId.

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

◆ setThreshold()

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

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

References $threshold.

Referenced by loadFromDb().

205  {
206  $this->threshold = $threshold;
207  }
+ 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: