ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilBibliograficDB80 Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilBibliograficDB80:
+ Collaboration diagram for ilBibliograficDB80:

Public Member Functions

 prepare (ilDBInterface $db)
 @inheritDoc More...
 
 step_1 ()
 
 step_2 ()
 This step serves the transfer from the old object specific online status implementation to the new centralized one. More...
 
- Public Member Functions inherited from ilDatabaseUpdateSteps
 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 

Protected Attributes

ilDBInterface $database
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilBibliograficDB80

Author
Thibeau Fuhrer thf@s.nosp@m.tude.nosp@m.r-rai.nosp@m.mann.nosp@m..ch

Definition at line 23 of file class.ilBibliograficDB80.php.

Member Function Documentation

◆ prepare()

ilBibliograficDB80::prepare ( ilDBInterface  $db)

@inheritDoc

Definition at line 30 of file class.ilBibliograficDB80.php.

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

References ILIAS\Repository\database().

+ Here is the call graph for this function:

◆ step_1()

ilBibliograficDB80::step_1 ( )

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

35 : void
36 {
37 if ($this->database->tableColumnExists('il_bibl_field', 'object_id')) {
38 $this->database->dropTableColumn('il_bibl_field', 'object_id');
39 }
40 }

References ILIAS\Repository\database().

+ Here is the call graph for this function:

◆ step_2()

ilBibliograficDB80::step_2 ( )

This step serves the transfer from the old object specific online status implementation to the new centralized one.

It will update the object_data offline column to the inverted value of the il_bibl_data is_online column for all bibl entries where the offline status is not set yet and an old is_online status exists.

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

48 : 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 }

References ILIAS\Repository\database().

+ Here is the call graph for this function:

Field Documentation

◆ $database

ilDBInterface ilBibliograficDB80::$database
protected

Definition at line 25 of file class.ilBibliograficDB80.php.


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