ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\LearningModule\Setup\LearningModuleDBUpdateSteps Class Reference
+ Inheritance diagram for ILIAS\LearningModule\Setup\LearningModuleDBUpdateSteps:
+ Collaboration diagram for ILIAS\LearningModule\Setup\LearningModuleDBUpdateSteps:

Public Member Functions

 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 
 step_1 ()
 
 step_2 ()
 
 step_3 ()
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

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

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

Member Function Documentation

◆ prepare()

ILIAS\LearningModule\Setup\LearningModuleDBUpdateSteps::prepare ( \ilDBInterface  $db)

Prepare the execution of the steps.

Do not use anything from the globals or the DIC inside your steps, only use the instance of the database provided here.

Implements ilDatabaseUpdateSteps.

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

References ILIAS\LearningModule\Setup\LearningModuleDBUpdateSteps\$db.

30  : void
31  {
32  $this->db = $db;
33  }

◆ step_1()

ILIAS\LearningModule\Setup\LearningModuleDBUpdateSteps::step_1 ( )

Definition at line 35 of file class.LearningModuleDBUpdateSteps.php.

35  : void
36  {
37  if (!$this->db->tableColumnExists('content_object', 'act_est_reading_time')) {
38  $this->db->addTableColumn('content_object', 'act_est_reading_time', array(
39  'type' => 'integer',
40  'notnull' => true,
41  'length' => 1,
42  'default' => 0
43  ));
44  }
45  }

◆ step_2()

ILIAS\LearningModule\Setup\LearningModuleDBUpdateSteps::step_2 ( )

Definition at line 47 of file class.LearningModuleDBUpdateSteps.php.

47  : void
48  {
49  if (!$this->db->tableColumnExists('content_object', 'est_reading_time')) {
50  $this->db->addTableColumn('content_object', 'est_reading_time', array(
51  'type' => 'integer',
52  'notnull' => true,
53  'length' => 4,
54  'default' => 0
55  ));
56  }
57  }

◆ step_3()

ILIAS\LearningModule\Setup\LearningModuleDBUpdateSteps::step_3 ( )

Definition at line 59 of file class.LearningModuleDBUpdateSteps.php.

59  : void
60  {
61  $this->db->update(
62  "ut_lp_settings",
63  [
64  "u_mode" => ["integer", 0]
65  ],
66  [ // where
67  "obj_type" => ["text", "lm"],
68  "u_mode" => ["integer", 3],
69  ]
70  );
71  $this->db->update(
72  "ut_lp_settings",
73  [
74  "u_mode" => ["integer", 0]
75  ],
76  [ // where
77  "obj_type" => ["text", "lm"],
78  "u_mode" => ["integer", 16],
79  ]
80  );
81  }

Field Documentation

◆ $db

ilDBInterface ILIAS\LearningModule\Setup\LearningModuleDBUpdateSteps::$db
protected

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