ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Setup\ilBookingManager8HotfixDBUpdateSteps Class Reference
+ Inheritance diagram for ILIAS\Setup\ilBookingManager8HotfixDBUpdateSteps:
+ Collaboration diagram for ILIAS\Setup\ilBookingManager8HotfixDBUpdateSteps:

Public Member Functions

 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 
 step_1 ()
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Member Function Documentation

◆ prepare()

ILIAS\Setup\ilBookingManager8HotfixDBUpdateSteps::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 27 of file class.ilBookingManager8HotfixDBUpdateSteps.php.

References ILIAS\Setup\ilBookingManager8HotfixDBUpdateSteps\$db.

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

◆ step_1()

ILIAS\Setup\ilBookingManager8HotfixDBUpdateSteps::step_1 ( )

Definition at line 32 of file class.ilBookingManager8HotfixDBUpdateSteps.php.

References ILIAS\Setup\ilBookingManager8HotfixDBUpdateSteps\$db, and ilDBInterface\queryF().

32  : void
33  {
34  $db = $this->db;
35  $set1 = $db->queryF(
36  "SELECT * FROM booking_object " .
37  " WHERE schedule_id = %s ",
38  ["integer"],
39  [1]
40  );
41  while ($rec1 = $db->fetchAssoc($set1)) {
42  $set2 = $db->queryF(
43  "SELECT * FROM booking_schedule " .
44  " WHERE pool_id = %s ORDER BY booking_schedule_id ASC LIMIT 1",
45  ["integer"],
46  [$rec1["pool_id"]]
47  );
48  if ($rec2 = $db->fetchAssoc($set2)) {
49  if ((int) $rec2["booking_schedule_id"] !== 1) {
50  $db->update(
51  "booking_object",
52  [
53  "schedule_id" => ["intger", $rec2["booking_schedule_id"]]
54  ],
55  [ // where
56  "booking_object_id" => ["integer", $rec1["booking_object_id"]]
57  ]
58  );
59  }
60  }
61  }
62  }
fetchAssoc(ilDBStatement $statement)
update(string $table_name, array $values, array $where)
$where MUST contain existing columns only.
queryF(string $query, array $types, array $values)
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ILIAS\Setup\ilBookingManager8HotfixDBUpdateSteps::$db
protected

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