ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilTestQuestionPool10DBUpdateSteps Class Reference
+ Inheritance diagram for ilTestQuestionPool10DBUpdateSteps:
+ Collaboration diagram for ilTestQuestionPool10DBUpdateSteps:

Public Member Functions

 prepare (ilDBInterface $db)
 
 step_1 ()
 
 step_2 ()
 
- Public Member Functions inherited from ilDatabaseUpdateSteps
 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Definition at line 21 of file class.ilTestQuestionPool10DBUpdateSteps.php.

Member Function Documentation

◆ prepare()

ilTestQuestionPool10DBUpdateSteps::prepare ( ilDBInterface  $db)

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

References $db.

25  : void
26  {
27  $this->db = $db;
28  }

◆ step_1()

ilTestQuestionPool10DBUpdateSteps::step_1 ( )

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

References ilDBConstants\T_TEXT.

30  : void
31  {
32  $this->db->manipulateF('UPDATE qpl_questions SET title=%s WHERE ISNULL(title)', [ilDBConstants::T_TEXT], ['']);
33  $this->db->manipulateF('UPDATE qpl_questions SET description=%s WHERE ISNULL(description)', [ilDBConstants::T_TEXT], ['']);
34  $this->db->manipulateF('UPDATE qpl_questions SET question_text=%s WHERE ISNULL(question_text)', [ilDBConstants::T_TEXT], ['']);
35  $this->db->manipulateF('UPDATE qpl_questions SET lifecycle=%s WHERE ISNULL(lifecycle)', [ilDBConstants::T_TEXT], ['draft']);
36  $this->db->manipulateF('UPDATE qpl_questions SET complete=%s WHERE ISNULL(complete)', [ilDBConstants::T_TEXT], ['1']);
37  $this->db->modifyTableColumn('qpl_questions', 'title', ['notnull' => 1, 'default' => '']);
38  $this->db->modifyTableColumn('qpl_questions', 'description', ['notnull' => 1, 'default' => '']);
39  $this->db->modifyTableColumn('qpl_questions', 'question_text', ['notnull' => 1, 'default' => '']);
40  $this->db->modifyTableColumn('qpl_questions', 'lifecycle', ['notnull' => 1, 'default' => 'draft']);
41  $this->db->modifyTableColumn('qpl_questions', 'complete', ['notnull' => 1, 'default' => '1']);
42  }

◆ step_2()

ilTestQuestionPool10DBUpdateSteps::step_2 ( )

Definition at line 44 of file class.ilTestQuestionPool10DBUpdateSteps.php.

44  : void
45  {
46  if ($this->db->tableColumnExists('qpl_questionpool', 'show_taxonomies')) {
47  $this->db->dropTableColumn('qpl_questionpool', 'show_taxonomies');
48  }
49  }

Field Documentation

◆ $db

ilDBInterface ilTestQuestionPool10DBUpdateSteps::$db
protected

Definition at line 23 of file class.ilTestQuestionPool10DBUpdateSteps.php.

Referenced by prepare().


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