ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ilCalendarDBUpdateSteps9 Class Reference
+ Inheritance diagram for ilCalendarDBUpdateSteps9:
+ Collaboration diagram for ilCalendarDBUpdateSteps9:

Public Member Functions

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

Protected Attributes

ilDBInterface $db
 

Detailed Description

Member Function Documentation

◆ prepare()

ilCalendarDBUpdateSteps9::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 28 of file class.ilCalendarDBUpdateSteps9.php.

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

References $db.

◆ step_1()

ilCalendarDBUpdateSteps9::step_1 ( )

Definition at line 33 of file class.ilCalendarDBUpdateSteps9.php.

33 : void
34 {
35 // Add indices
36 if (!$this->db->indexExistsByFields('cal_entries', ['starta'])) {
37 $this->db->addIndex('cal_entries', ['starta'], 'i3');
38 }
39 if (!$this->db->indexExistsByFields('cal_entries', ['enda'])) {
40 $this->db->addIndex('cal_entries', ['enda'], 'i4');
41 }
42 }

◆ step_2()

ilCalendarDBUpdateSteps9::step_2 ( )

Definition at line 44 of file class.ilCalendarDBUpdateSteps9.php.

44 : void
45 {
46 // Removes is_milestones column from cal_entries
47 if ($this->db->tableExists('cal_entries')
48 && $this->db->tableColumnExists('cal_entries', 'is_milestone')) {
49 $this->db->dropTableColumn('cal_entries', 'is_milestone');
50 }
51 // Removes completion column from cal_entries
52 if ($this->db->tableExists('cal_entries')
53 && $this->db->tableColumnExists('cal_entries', 'completion')) {
54 $this->db->dropTableColumn('cal_entries', 'completion');
55 }
56 // Deletes table cal_entry_responsible
57 if ($this->db->tableExists('cal_entry_responsible')) {
58 $this->db->dropTable('cal_entry_responsible');
59 }
60
61 $query = 'delete from settings where ' .
62 'keyword = ' . $this->db->quote('enable_grp_milestones', ilDBConstants::T_TEXT) . ' ' .
63 'and module = ' . $this->db->quote('calendar', ilDBConstants::T_TEXT);
64 $this->db->manipulate($query);
65 }

References ilDBConstants\T_TEXT.

Field Documentation

◆ $db

ilDBInterface ilCalendarDBUpdateSteps9::$db
protected

Definition at line 26 of file class.ilCalendarDBUpdateSteps9.php.

Referenced by prepare().


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