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

Public Member Functions

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

Protected Attributes

ilDBInterface $db
 

Detailed Description

Definition at line 21 of file class.ilObject9DBUpdateSteps.php.

Member Function Documentation

◆ prepare()

ILIAS\Object\Setup\ilObject9DBUpdateSteps::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 25 of file class.ilObject9DBUpdateSteps.php.

References ILIAS\Object\Setup\ilObject9DBUpdateSteps\$db.

25  : void
26  {
27  $this->db = $db;
28  }

◆ step_1()

ILIAS\Object\Setup\ilObject9DBUpdateSteps::step_1 ( )

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

30  : void
31  {
32  if (!$this->db->tableColumnExists('object_data', 'tile_image_rid')) {
33  $this->db->addTableColumn(
34  'object_data',
35  'tile_image_rid',
36  [
37  'type' => 'text',
38  'notnull' => false,
39  'length' => 64,
40  'default' => ''
41  ]
42  );
43  }
44  }

◆ step_2()

ILIAS\Object\Setup\ilObject9DBUpdateSteps::step_2 ( )

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

46  : void
47  {
48  if ($this->db->tableColumnExists('object_data', 'type')) {
49  $this->db->manipulate(
50  'UPDATE object_data SET type = "" WHERE type IS NULL'
51  );
52  $this->db->modifyTableColumn(
53  'object_data',
54  'type',
55  [
56  'type' => 'text',
57  'notnull' => true,
58  'length' => 4,
59  'default' => 'none'
60  ]
61  );
62  }
63 
64  if ($this->db->tableColumnExists('object_data', 'title')) {
65  $this->db->manipulate(
66  'UPDATE object_data SET title = "" WHERE title IS NULL'
67  );
68  $this->db->modifyTableColumn(
69  'object_data',
70  'title',
71  [
72  'type' => 'text',
73  'notnull' => true,
74  'length' => 255,
75  'default' => ''
76  ]
77  );
78  }
79 
80  if ($this->db->tableColumnExists('object_data', 'description')) {
81  $this->db->manipulate(
82  'UPDATE object_data SET description = "" WHERE description IS NULL'
83  );
84  $this->db->modifyTableColumn(
85  'object_data',
86  'description',
87  [
88  'type' => 'text',
89  'notnull' => true,
90  'length' => 128,
91  'default' => ''
92  ]
93  );
94  }
95  }

Field Documentation

◆ $db

ilDBInterface ILIAS\Object\Setup\ilObject9DBUpdateSteps::$db
protected

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