ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilSurveySkillThresholds Class Reference

Skill tresholds for 360 surveys. More...

+ Collaboration diagram for ilSurveySkillThresholds:

Public Member Functions

 __construct (ilObjSurvey $a_survey)
 
 read ()
 
 getThresholds ()
 
 writeThreshold (int $a_base_skill_id, int $a_tref_id, int $a_level_id, int $a_threshold)
 
 cloneTo (ilObjSurvey $target_survey, array $mapping)
 

Protected Attributes

ilObjSurvey $survey
 
ilDBInterface $db
 
array $threshold = []
 

Detailed Description

Skill tresholds for 360 surveys.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilSurveySkillThresholds::__construct ( ilObjSurvey  $a_survey)

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

33 {
34 global $DIC;
35
36 $this->db = $DIC->database();
37 $this->survey = $a_survey;
38 $this->read();
39 }
global $DIC
Definition: shib_login.php:26

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 81 of file class.ilSurveySkillThresholds.php.

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

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getThresholds()

ilSurveySkillThresholds::getThresholds ( )
Returns
array<int, array<int, int>>

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

57 : array
58 {
59 return $this->threshold;
60 }

References $threshold.

◆ read()

ilSurveySkillThresholds::read ( )

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

41 : void
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[(int) $rec['level_id']][(int) $rec['tref_id']] = (int) $rec['threshold'];
51 }
52 }

References $db, $ilDB, and ILIAS\Repository\int().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeThreshold()

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

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

67 : void {
69
70 $ilDB->replace(
71 "svy_skill_threshold",
72 array("survey_id" => array("integer", $this->survey->getId()),
73 "base_skill_id" => array("integer", $a_base_skill_id),
74 "tref_id" => array("integer", $a_tref_id),
75 "level_id" => array("integer", $a_level_id)
76 ),
77 array("threshold" => array("integer", $a_threshold))
78 );
79 }

Field Documentation

◆ $db

ilDBInterface ilSurveySkillThresholds::$db
protected

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

Referenced by read().

◆ $survey

ilObjSurvey ilSurveySkillThresholds::$survey
protected

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

◆ $threshold

array ilSurveySkillThresholds::$threshold = []
protected

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

Referenced by getThresholds().


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