ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilIntroduceComponentArtifactDBUpdateSteps Class Reference
+ Inheritance diagram for ilIntroduceComponentArtifactDBUpdateSteps:
+ Collaboration diagram for ilIntroduceComponentArtifactDBUpdateSteps:

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 ()
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Member Function Documentation

◆ prepare()

ilIntroduceComponentArtifactDBUpdateSteps::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 28 of file class.ilIntroduceComponentArtifactDBUpdateSteps.php.

References $db.

28  : void
29  {
30  $this->db = $db;
31  }

◆ step_1()

ilIntroduceComponentArtifactDBUpdateSteps::step_1 ( )

Definition at line 33 of file class.ilIntroduceComponentArtifactDBUpdateSteps.php.

33  : void
34  {
35  $this->db->dropTable("il_component");
36  }

◆ step_2()

ilIntroduceComponentArtifactDBUpdateSteps::step_2 ( )

Definition at line 38 of file class.ilIntroduceComponentArtifactDBUpdateSteps.php.

38  : void
39  {
40  $this->db->dropTable("il_pluginslot");
41  }

◆ step_3()

ilIntroduceComponentArtifactDBUpdateSteps::step_3 ( )

Definition at line 43 of file class.ilIntroduceComponentArtifactDBUpdateSteps.php.

43  : void
44  {
45  $this->db->manipulate("DELETE FROM il_plugin WHERE plugin_id IS NULL");
46  }

◆ step_4()

ilIntroduceComponentArtifactDBUpdateSteps::step_4 ( )

Definition at line 48 of file class.ilIntroduceComponentArtifactDBUpdateSteps.php.

References Vendor\Package\$e.

48  : void
49  {
50  try {
51  $this->db->addPrimaryKey("il_plugin", ["plugin_id"]);
52  } catch (\PDOException $e) {
53  $this->db->dropPrimaryKey("il_plugin");
54  $this->db->addPrimaryKey("il_plugin", ["plugin_id"]);
55  }
56  }

◆ step_5()

ilIntroduceComponentArtifactDBUpdateSteps::step_5 ( )

Definition at line 58 of file class.ilIntroduceComponentArtifactDBUpdateSteps.php.

58  : void
59  {
60  if (!$this->db->tableColumnExists("il_plugin", "component_type")) {
61  return;
62  }
63 
64  $this->db->dropTableColumn("il_plugin", "component_type");
65  }

◆ step_6()

ilIntroduceComponentArtifactDBUpdateSteps::step_6 ( )

Definition at line 67 of file class.ilIntroduceComponentArtifactDBUpdateSteps.php.

67  : void
68  {
69  if (!$this->db->tableColumnExists("il_plugin", "component_name")) {
70  return;
71  }
72 
73  $this->db->dropTableColumn("il_plugin", "component_name");
74  }

◆ step_7()

ilIntroduceComponentArtifactDBUpdateSteps::step_7 ( )

Definition at line 76 of file class.ilIntroduceComponentArtifactDBUpdateSteps.php.

76  : void
77  {
78  if (!$this->db->tableColumnExists("il_plugin", "slot_id")) {
79  return;
80  }
81 
82  $this->db->dropTableColumn("il_plugin", "slot_id");
83  }

◆ step_8()

ilIntroduceComponentArtifactDBUpdateSteps::step_8 ( )

Definition at line 85 of file class.ilIntroduceComponentArtifactDBUpdateSteps.php.

85  : void
86  {
87  if (!$this->db->tableColumnExists("il_plugin", "name")) {
88  return;
89  }
90 
91  $this->db->dropTableColumn("il_plugin", "name");
92  }

Field Documentation

◆ $db

ilDBInterface ilIntroduceComponentArtifactDBUpdateSteps::$db
protected

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

Referenced by prepare().


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