ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps Class Reference
+ Inheritance diagram for ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps:
+ Collaboration diagram for ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps:

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

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.ilBookingManagerDBUpdateSteps.php.

Member Function Documentation

◆ prepare()

ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps::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.ilBookingManagerDBUpdateSteps.php.

References ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps\$db.

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

◆ step_1()

ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps::step_1 ( )

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

35  : void
36  {
37  if (!$this->db->indexExistsByFields('booking_reservation', ['context_obj_id'])) {
38  $this->db->addIndex('booking_reservation', ['context_obj_id'], 'i5');
39  }
40  }

◆ step_2()

ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps::step_2 ( )

Definition at line 42 of file class.ilBookingManagerDBUpdateSteps.php.

42  : void
43  {
44  if (!$this->db->indexExistsByFields('booking_schedule', ['pool_id'])) {
45  $this->db->addIndex('booking_schedule', ['pool_id'], 'i1');
46  }
47  }

◆ step_3()

ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps::step_3 ( )

Definition at line 49 of file class.ilBookingManagerDBUpdateSteps.php.

49  : void
50  {
51  if (!$this->db->indexExistsByFields('booking_object', ['schedule_id'])) {
52  $this->db->addIndex('booking_object', ['schedule_id'], 'i2');
53  }
54  }

◆ step_4()

ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps::step_4 ( )

Definition at line 56 of file class.ilBookingManagerDBUpdateSteps.php.

References ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps\$db.

56  : void
57  {
58  $db = $this->db;
59  if (!$db->tableExists("book_sel_object")) {
60  $fields = array(
61  "user_id" => array(
62  "type" => "integer",
63  "notnull" => true,
64  "length" => 4,
65  "default" => 0
66  ),
67  "object_id" => array(
68  "type" => "integer",
69  "notnull" => true,
70  "length" => 4,
71  "default" => 0
72  )
73  );
74  $db->createTable("book_sel_object", $fields);
75  $db->addPrimaryKey("book_sel_object", ["user_id", "object_id"]);
76  }
77  }
tableExists(string $table_name)
addPrimaryKey(string $table_name, array $primary_keys)
createTable(string $table_name, array $fields, bool $drop_table=false, bool $ignore_erros=false)

◆ step_5()

ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps::step_5 ( )

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

References ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps\$db, and ilDBInterface\addTableColumn().

79  : void
80  {
81  $db = $this->db;
82  if (!$db->tableColumnExists("book_sel_object", "pool_id")) {
83  $db->addTableColumn("book_sel_object", "pool_id", [
84  "type" => "integer",
85  "notnull" => true,
86  "length" => 4,
87  "default" => 0
88  ]);
89  }
90  }
tableColumnExists(string $table_name, string $column_name)
addTableColumn(string $table_name, string $column_name, array $attributes)
+ Here is the call graph for this function:

◆ step_6()

ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps::step_6 ( )

Definition at line 92 of file class.ilBookingManagerDBUpdateSteps.php.

References ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps\$db, and ilDBInterface\addTableColumn().

92  : void
93  {
94  $db = $this->db;
95  if (!$db->tableColumnExists("booking_settings", "messages")) {
96  $db->addTableColumn("booking_settings", "messages", [
97  "type" => "integer",
98  "notnull" => true,
99  "length" => 4,
100  "default" => 0
101  ]);
102  }
103  }
tableColumnExists(string $table_name, string $column_name)
addTableColumn(string $table_name, string $column_name, array $attributes)
+ Here is the call graph for this function:

◆ step_7()

ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps::step_7 ( )

Definition at line 105 of file class.ilBookingManagerDBUpdateSteps.php.

References ILIAS\BookingManager\Setup\ilBookingManagerDBUpdateSteps\$db, and ilDBInterface\addTableColumn().

105  : void
106  {
107  $db = $this->db;
108  if (!$db->tableColumnExists("booking_reservation", "message")) {
109  $db->addTableColumn("booking_reservation", "message", [
110  "type" => "text",
111  "notnull" => true,
112  "length" => 4000,
113  "default" => ""
114  ]);
115  }
116  }
tableColumnExists(string $table_name, string $column_name)
addTableColumn(string $table_name, string $column_name, array $attributes)
+ Here is the call graph for this function:

Field Documentation

◆ $db


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