ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 27 of file class.ilCalendarDBUpdateSteps9.php.

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

References $db.

◆ step_1()

ilCalendarDBUpdateSteps9::step_1 ( )

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

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

◆ step_2()

ilCalendarDBUpdateSteps9::step_2 ( )

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

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

References ilDBConstants\T_TEXT.

Field Documentation

◆ $db

ilDBInterface ilCalendarDBUpdateSteps9::$db
protected

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

Referenced by prepare().


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