ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSkillDBUpdateSteps Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilSkillDBUpdateSteps:
+ Collaboration diagram for ilSkillDBUpdateSteps:

Public Member Functions

 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 
 step_1 ()
 
 step_2 ()
 
 step_3 ()
 
 step_4 ()
 
 step_5 ()
 
 step_6 ()
 
 step_7 ()
 
 step_8 ()
 
 step_9 ()
 
 step_10 ()
 
 step_11 ()
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 22 of file class.ilSkillDBUpdateSteps.php.

Member Function Documentation

◆ prepare()

ilSkillDBUpdateSteps::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 26 of file class.ilSkillDBUpdateSteps.php.

References $db.

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

◆ step_1()

ilSkillDBUpdateSteps::step_1 ( )

Definition at line 31 of file class.ilSkillDBUpdateSteps.php.

31  : void
32  {
33  if ($this->db->sequenceExists('skl_self_eval')) {
34  $this->db->dropSequence('skl_self_eval');
35  }
36 
37  if ($this->db->tableExists('skl_self_eval')) {
38  $this->db->dropTable('skl_self_eval');
39  }
40 
41  if ($this->db->tableExists('skl_self_eval_level')) {
42  $this->db->dropTable('skl_self_eval_level');
43  }
44  }

◆ step_10()

ilSkillDBUpdateSteps::step_10 ( )

Definition at line 157 of file class.ilSkillDBUpdateSteps.php.

157  : void
158  {
159  if (!$this->db->tableColumnExists("skl_profile", "image_id")) {
160  $this->db->addTableColumn("skl_profile", "image_id", array(
161  "type" => "text",
162  "notnull" => true,
163  "length" => 4000
164  ));
165  }
166  }

◆ step_11()

ilSkillDBUpdateSteps::step_11 ( )

Definition at line 168 of file class.ilSkillDBUpdateSteps.php.

168  : void
169  {
170  if (!$this->db->tableExists("skl_profile_completion")) {
171  $fields = [
172  "profile_id" => [
173  "type" => "integer",
174  "length" => 4,
175  "notnull" => true
176  ],
177  "user_id" => [
178  "type" => "integer",
179  "length" => 4,
180  "notnull" => true
181  ],
182  "date" => [
183  "type" => "timestamp",
184  "notnull" => true
185  ],
186  "fulfilled" => [
187  "type" => "integer",
188  "length" => 1,
189  "notnull" => true
190  ]
191  ];
192  $this->db->createTable("skl_profile_completion", $fields);
193  $this->db->addPrimaryKey("skl_profile_completion", ["profile_id", "user_id", "date"]);
194  }
195  }

◆ step_2()

ilSkillDBUpdateSteps::step_2 ( )

Definition at line 46 of file class.ilSkillDBUpdateSteps.php.

46  : void
47  {
48  if (!$this->db->tableColumnExists('skl_user_skill_level', 'trigger_user_id')) {
49  $this->db->addTableColumn(
50  'skl_user_skill_level',
51  'trigger_user_id',
52  array(
53  'type' => 'text',
54  'notnull' => true,
55  'length' => 20,
56  'default' => "-"
57  )
58  );
59  }
60  }

◆ step_3()

ilSkillDBUpdateSteps::step_3 ( )

Definition at line 62 of file class.ilSkillDBUpdateSteps.php.

62  : void
63  {
64  if (!$this->db->tableColumnExists('skl_user_has_level', 'trigger_user_id')) {
65  $this->db->addTableColumn(
66  'skl_user_has_level',
67  'trigger_user_id',
68  array(
69  'type' => 'text',
70  'notnull' => true,
71  'length' => 20,
72  'default' => "-"
73  )
74  );
75  }
76  }

◆ step_4()

ilSkillDBUpdateSteps::step_4 ( )

Definition at line 78 of file class.ilSkillDBUpdateSteps.php.

78  : void
79  {
80  // moved to ilSkillSetupAgent using Objectives
81  }

◆ step_5()

ilSkillDBUpdateSteps::step_5 ( )

Definition at line 83 of file class.ilSkillDBUpdateSteps.php.

83  : void
84  {
85  // moved to ilSkillSetupAgent using Objectives
86  }

◆ step_6()

ilSkillDBUpdateSteps::step_6 ( )

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

88  : void
89  {
90  $this->db->update(
91  "object_data",
92  [
93  "title" => ["text", "Default"],
94  "description" => ["text", ""]
95  ],
96  [ // where
97  "type" => ["text", "skee"],
98  "title" => ["text", "Skill Tree"]
99  ]
100  );
101  }

◆ step_7()

ilSkillDBUpdateSteps::step_7 ( )

Definition at line 103 of file class.ilSkillDBUpdateSteps.php.

103  : void
104  {
105  $set = $this->db->queryF(
106  "SELECT * FROM object_data " .
107  " WHERE type = %s AND title = %s",
108  ["string", "string"],
109  ["skee", "Default"]
110  );
111  $rec = $this->db->fetchAssoc($set);
112 
113  $this->db->update(
114  "skl_tree",
115  [
116  "skl_tree_id" => ["integer", $rec["obj_id"]]
117  ],
118  [ // where
119  "skl_tree_id" => ["integer", 1]
120  ]
121  );
122  }

◆ step_8()

ilSkillDBUpdateSteps::step_8 ( )

Definition at line 124 of file class.ilSkillDBUpdateSteps.php.

124  : void
125  {
126  if (!$this->db->tableColumnExists("skl_profile", "skill_tree_id")) {
127  $this->db->addTableColumn("skl_profile", "skill_tree_id", array(
128  "type" => "integer",
129  "notnull" => true,
130  "default" => 0,
131  "length" => 4
132  ));
133  }
134  }

◆ step_9()

ilSkillDBUpdateSteps::step_9 ( )

Definition at line 136 of file class.ilSkillDBUpdateSteps.php.

136  : void
137  {
138  $set = $this->db->queryF(
139  "SELECT * FROM object_data " .
140  " WHERE type = %s AND title = %s",
141  ["string", "string"],
142  ["skee", "Default"]
143  );
144  $rec = $this->db->fetchAssoc($set);
145 
146  $this->db->update(
147  "skl_profile",
148  [
149  "skill_tree_id" => ["integer", $rec["obj_id"]]
150  ],
151  [ // where
152  "skill_tree_id" => ["integer", 0]
153  ]
154  );
155  }

Field Documentation

◆ $db

ilDBInterface ilSkillDBUpdateSteps::$db
protected

Definition at line 24 of file class.ilSkillDBUpdateSteps.php.

Referenced by prepare().


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