ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 29 of file class.ilIntroduceComponentArtifactDBUpdateSteps.php.

References $db.

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

◆ step_1()

ilIntroduceComponentArtifactDBUpdateSteps::step_1 ( )

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

34  : void
35  {
36  if ($this->db->tableExists("il_compoment")) {
37  $this->db->dropTable("il_component");
38  }
39  }

◆ step_2()

ilIntroduceComponentArtifactDBUpdateSteps::step_2 ( )

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

41  : void
42  {
43  $this->db->dropTable("il_pluginslot");
44  }

◆ step_3()

ilIntroduceComponentArtifactDBUpdateSteps::step_3 ( )

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

46  : void
47  {
48  $this->db->manipulate("DELETE FROM il_plugin WHERE plugin_id IS NULL");
49  }

◆ step_4()

ilIntroduceComponentArtifactDBUpdateSteps::step_4 ( )

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

References Vendor\Package\$e.

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

◆ step_5()

ilIntroduceComponentArtifactDBUpdateSteps::step_5 ( )

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

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

◆ step_6()

ilIntroduceComponentArtifactDBUpdateSteps::step_6 ( )

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

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

◆ step_7()

ilIntroduceComponentArtifactDBUpdateSteps::step_7 ( )

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

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

◆ step_8()

ilIntroduceComponentArtifactDBUpdateSteps::step_8 ( )

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

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

Field Documentation

◆ $db

ilDBInterface ilIntroduceComponentArtifactDBUpdateSteps::$db
protected

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

Referenced by prepare().


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