ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilAssQuestionSolutionComparisonExpressionList Class Reference
+ Collaboration diagram for ilAssQuestionSolutionComparisonExpressionList:

Public Member Functions

 __construct (ilDB $db)
 
 load ()
 
 save ()
 
 delete ()
 
 add (ilAssQuestionSolutionComparisonExpression $expression)
 
 get ()
 
 reset ()
 
 getQuestionId ()
 
 setQuestionId ($questionId)
 
 getSkillBaseId ()
 
 setSkillBaseId ($skillBaseId)
 
 getSkillTrefId ()
 
 setSkillTrefId ($skillTrefId)
 

Protected Attributes

 $db
 

Private Attributes

 $questionId
 
 $skillBaseId
 
 $skillTrefId
 
 $expressions
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionSolutionComparisonExpressionList::__construct ( ilDB  $db)
Parameters
ilDB$db

Definition at line 42 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

43 {
44 $this->db = $db;
45
46 $this->questionId = null;
47 $this->skillBaseId = null;
48 $this->skillTrefId = null;
49
50 $this->expressions = array();
51 }

References $db.

Member Function Documentation

◆ add()

ilAssQuestionSolutionComparisonExpressionList::add ( ilAssQuestionSolutionComparisonExpression  $expression)

Definition at line 100 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References ilAssQuestionSolutionComparisonExpression\getOrderIndex(), getQuestionId(), getSkillBaseId(), getSkillTrefId(), ilAssQuestionSolutionComparisonExpression\setDb(), ilAssQuestionSolutionComparisonExpression\setQuestionId(), ilAssQuestionSolutionComparisonExpression\setSkillBaseId(), and ilAssQuestionSolutionComparisonExpression\setSkillTrefId().

Referenced by load().

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

◆ delete()

ilAssQuestionSolutionComparisonExpressionList::delete ( )

Definition at line 88 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

89 {
90 $query = "
91 DELETE FROM qpl_qst_skl_sol_expr
92 WHERE question_fi = %s AND skill_base_fi = %s AND skill_tref_fi = %s
93 ";
94
95 $this->db->manipulateF($query, array('integer', 'integer', 'integer'),
96 array($this->getQuestionId(), $this->getSkillBaseId(), $this->getSkillTrefId())
97 );
98 }

References $query, getQuestionId(), getSkillBaseId(), and getSkillTrefId().

+ Here is the call graph for this function:

◆ get()

ilAssQuestionSolutionComparisonExpressionList::get ( )

◆ getQuestionId()

ilAssQuestionSolutionComparisonExpressionList::getQuestionId ( )

◆ getSkillBaseId()

ilAssQuestionSolutionComparisonExpressionList::getSkillBaseId ( )
Returns
int

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

References $skillBaseId.

Referenced by add(), delete(), and load().

+ Here is the caller graph for this function:

◆ getSkillTrefId()

ilAssQuestionSolutionComparisonExpressionList::getSkillTrefId ( )
Returns
int

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

References $skillTrefId.

Referenced by add(), delete(), and load().

+ Here is the caller graph for this function:

◆ load()

ilAssQuestionSolutionComparisonExpressionList::load ( )

Definition at line 53 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

54 {
55 $query = "
56 SELECT *
57 FROM qpl_qst_skl_sol_expr
58 WHERE question_fi = %s AND skill_base_fi = %s AND skill_tref_fi = %s
59 ";
60
61 $res = $this->db->queryF( $query, array('integer', 'integer', 'integer'),
62 array($this->getQuestionId(), $this->getSkillBaseId(), $this->getSkillTrefId())
63 );
64
65 while($row = $this->db->fetchAssoc($res) )
66 {
68 $expression->setDb($this->db);
69 $expression->initInstanceFromArray($row);
70
71 $this->add($expression);
72 }
73 }

References $query, $res, $row, add(), getQuestionId(), getSkillBaseId(), and getSkillTrefId().

+ Here is the call graph for this function:

◆ reset()

ilAssQuestionSolutionComparisonExpressionList::reset ( )

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

116 {
117 $this->expressions = array();
118 }

◆ save()

ilAssQuestionSolutionComparisonExpressionList::save ( )

Definition at line 75 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

76 {
77 $this->delete();
78
79 foreach($this->expressions as $orderIndex => $expression)
80 {
81 /* @var ilAssQuestionSolutionComparisonExpression $expression */
82
83 $expression->setQuestionId($this->getQuestionId());
84 $expression->save();
85 }
86 }

References getQuestionId().

+ Here is the call graph for this function:

◆ setQuestionId()

ilAssQuestionSolutionComparisonExpressionList::setQuestionId (   $questionId)
Parameters
int$questionId

Definition at line 131 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

132 {
133 $this->questionId = $questionId;
134 }

References $questionId.

◆ setSkillBaseId()

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

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

148 {
149 $this->skillBaseId = $skillBaseId;
150 }

References $skillBaseId.

◆ setSkillTrefId()

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

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

164 {
165 $this->skillTrefId = $skillTrefId;
166 }

References $skillTrefId.

Field Documentation

◆ $db

ilAssQuestionSolutionComparisonExpressionList::$db
protected

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

Referenced by __construct().

◆ $expressions

ilAssQuestionSolutionComparisonExpressionList::$expressions
private

Definition at line 37 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

Referenced by get().

◆ $questionId

ilAssQuestionSolutionComparisonExpressionList::$questionId
private

◆ $skillBaseId

ilAssQuestionSolutionComparisonExpressionList::$skillBaseId
private

◆ $skillTrefId

ilAssQuestionSolutionComparisonExpressionList::$skillTrefId
private

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