ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilBibliograficDB80.php
Go to the documentation of this file.
1<?php
2
24{
26
30 public function prepare(ilDBInterface $db): void
31 {
32 $this->database = $db;
33 }
34
35 public function step_1(): void
36 {
37 if ($this->database->tableColumnExists('il_bibl_field', 'object_id')) {
38 $this->database->dropTableColumn('il_bibl_field', 'object_id');
39 }
40 }
41
48 public function step_2(): void
49 {
50 if ($this->database->tableColumnExists('il_bibl_data', 'is_online')
51 && $this->database->tableColumnExists('object_data', 'offline')
52 ) {
53 $bibl_data = $this->database->fetchAll(
54 $this->database->query('SELECT * FROM il_bibl_data')
55 );
56 foreach ($bibl_data as $bibl_data_entry) {
57 if (isset($bibl_data_entry['is_online'])) {
58 $query = "UPDATE `object_data` SET `offline` = %s WHERE `obj_id` = %s AND `type` = %s AND `offline` IS NULL";
59 $this->database->manipulateF(
60 $query,
61 ['integer', 'integer', 'text'],
62 [
63 !$bibl_data_entry['is_online'],
64 $bibl_data_entry['id'],
65 'bibl'
66 ]
67 );
68 }
69 }
70 $this->database->dropTableColumn('il_bibl_data', 'is_online');
71 }
72 }
73}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
step_2()
This step serves the transfer from the old object specific online status implementation to the new ce...
prepare(ilDBInterface $db)
@inheritDoc
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...