ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
class.LearningModuleDBUpdateSteps.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 {
28  protected \ilDBInterface $db;
29 
30  public function prepare(\ilDBInterface $db): void
31  {
32  $this->db = $db;
33  }
34 
35  public function step_1(): 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  }
46 
47  public function step_2(): 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  }
58 
59  public function step_3(): 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  }
82 
83 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
prepare(\ilDBInterface $db)
Prepare the execution of the steps.