ILIAS  release_7 Revision v7.30-3-g800a261c036
ilSurveySkillThresholds Class Reference

Skill tresholds for 360 surveys. More...

+ Collaboration diagram for ilSurveySkillThresholds:

Public Member Functions

 __construct (ilObjSurvey $a_survey)
 Constructor. More...
 
 read ()
 Read. More...
 
 getThresholds ()
 Get thresholds. More...
 
 writeThreshold ($a_base_skill_id, $a_tref_id, $a_level_id, $a_threshold)
 Write threshold. More...
 
 cloneTo (ilObjSurvey $target_survey, array $mapping)
 

Protected Attributes

 $db
 

Detailed Description

Skill tresholds for 360 surveys.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilSurveySkillThresholds::__construct ( ilObjSurvey  $a_survey)

Constructor.

Parameters

return

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

27 {
28 global $DIC;
29
30 $this->db = $DIC->database();
31 $this->survey = $a_survey;
32 $this->read();
33 }
global $DIC
Definition: goto.php:24

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ cloneTo()

ilSurveySkillThresholds::cloneTo ( ilObjSurvey  $target_survey,
array  $mapping 
)

Definition at line 87 of file class.ilSurveySkillThresholds.php.

87 : void
88 {
89 $target_thresholds = new self($target_survey);
90 $set = $this->db->queryF("SELECT * FROM svy_skill_threshold " .
91 " WHERE survey_id = %s ",
92 ["integer"],
93 [$this->survey->getId()]
94 );
95 while ($rec = $this->db->fetchAssoc($set)) {
96 $target_thresholds->writeThreshold(
97 (int) $rec["base_skill_id"],
98 (int) $rec["tref_id"],
99 (int) $rec["level_id"],
100 (int) $rec["threshold"]
101 );
102 }
103 }

◆ getThresholds()

ilSurveySkillThresholds::getThresholds ( )

Get thresholds.

Parameters

return

Definition at line 61 of file class.ilSurveySkillThresholds.php.

62 {
63 return $this->threshold;
64 }

◆ read()

ilSurveySkillThresholds::read ( )

Read.

Parameters

return

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

42 {
44
45 $set = $ilDB->query(
46 "SELECT * FROM svy_skill_threshold " .
47 " WHERE survey_id = " . $ilDB->quote($this->survey->getId(), "integer")
48 );
49 while ($rec = $ilDB->fetchAssoc($set)) {
50 $this->threshold[$rec['level_id']][$rec['tref_id']] =
51 $rec['threshold'];
52 }
53 }
global $ilDB

References $db, and $ilDB.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ writeThreshold()

ilSurveySkillThresholds::writeThreshold (   $a_base_skill_id,
  $a_tref_id,
  $a_level_id,
  $a_threshold 
)

Write threshold.

Parameters

return

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

73 {
75
76 $ilDB->replace(
77 "svy_skill_threshold",
78 array("survey_id" => array("integer", $this->survey->getId()),
79 "base_skill_id" => array("integer", (int) $a_base_skill_id),
80 "tref_id" => array("integer", (int) $a_tref_id),
81 "level_id" => array("integer", (int) $a_level_id)
82 ),
83 array("threshold" => array("integer", (int) $a_threshold))
84 );
85 }

References $db, and $ilDB.

Field Documentation

◆ $db

ilSurveySkillThresholds::$db
protected

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

Referenced by read(), and writeThreshold().


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