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

Public Member Functions

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

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

References $db, and array.

43  {
44  $this->db = $db;
45 
46  $this->questionId = null;
47  $this->skillBaseId = null;
48  $this->skillTrefId = null;
49 
50  $this->expressions = array();
51  }
Create styles array
The data for the language used.

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.

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

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  }
Create styles array
The data for the language used.
+ 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.

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

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  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ reset()

ilAssQuestionSolutionComparisonExpressionList::reset ( )

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

References array.

116  {
117  $this->expressions = array();
118  }
Create styles array
The data for the language used.

◆ save()

ilAssQuestionSolutionComparisonExpressionList::save ( )

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

References getQuestionId().

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  }
+ Here is the call graph for this function:

◆ setQuestionId()

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

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

References $questionId.

◆ setSkillBaseId()

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

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

References $skillBaseId.

◆ setSkillTrefId()

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

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

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: