ILIAS  release_8 Revision v8.24
ilStudyProgrammeProgressTableUpdateSteps 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 ilStudyProgrammeProgressTableUpdateSteps:
+ Collaboration diagram for ilStudyProgrammeProgressTableUpdateSteps:

Public Member Functions

 prepare (ilDBInterface $db)
 
 step_1 ()
 
 step_2 ()
 
 step_3 ()
 
- Public Member Functions inherited from ilDatabaseUpdateSteps
 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 

Protected Attributes

ilDBInterface $db
 

Private Attributes

const TABLE_NAME = 'prg_usr_progress'
 

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

Definition at line 21 of file ilStudyProgrammeProgressTableUpdateSteps.php.

Member Function Documentation

◆ prepare()

ilStudyProgrammeProgressTableUpdateSteps::prepare ( ilDBInterface  $db)

Definition at line 27 of file ilStudyProgrammeProgressTableUpdateSteps.php.

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

References $db.

◆ step_1()

ilStudyProgrammeProgressTableUpdateSteps::step_1 ( )

Definition at line 32 of file ilStudyProgrammeProgressTableUpdateSteps.php.

32 : void
33 {
34 $column_name = 'individual';
35
36 if (!$this->db->tableColumnExists(self::TABLE_NAME, $column_name)) {
37 $this->db->addTableColumn(
38 self::TABLE_NAME,
39 $column_name,
40 [
41 "type" => "integer",
42 "length" => 1,
43 "notnull" => true,
44 "default" => 0
45 ]
46 );
47 $query = 'UPDATE ' . self::TABLE_NAME
48 . ' SET ' . $column_name . ' = 1'
49 . ' WHERE last_change_by IS NOT NULL';
50 $this->db->manipulate($query);
51 }
52 }
$query

References $query.

◆ step_2()

ilStudyProgrammeProgressTableUpdateSteps::step_2 ( )

Definition at line 54 of file ilStudyProgrammeProgressTableUpdateSteps.php.

54 : void
55 {
56 $old = "risky_to_fail_mail_send";
57 $new = "sent_mail_risky_to_fail";
58
59 if ($this->db->tableColumnExists(self::TABLE_NAME, $old) && !$this->db->tableColumnExists(self::TABLE_NAME, $new)) {
60 $this->db->renameTableColumn(self::TABLE_NAME, $old, $new);
61 }
62 }

◆ step_3()

ilStudyProgrammeProgressTableUpdateSteps::step_3 ( )

Definition at line 64 of file ilStudyProgrammeProgressTableUpdateSteps.php.

64 : void
65 {
66 $column_name = 'sent_mail_expires';
67
68 if (!$this->db->tableColumnExists(self::TABLE_NAME, $column_name)) {
69 $this->db->addTableColumn(
70 self::TABLE_NAME,
71 $column_name,
72 [
73 "type" => "timestamp",
74 "notnull" => false
75 ]
76 );
77 }
78 }

Field Documentation

◆ $db

ilDBInterface ilStudyProgrammeProgressTableUpdateSteps::$db
protected

Definition at line 25 of file ilStudyProgrammeProgressTableUpdateSteps.php.

Referenced by prepare().

◆ TABLE_NAME

const ilStudyProgrammeProgressTableUpdateSteps::TABLE_NAME = 'prg_usr_progress'
private

Definition at line 23 of file ilStudyProgrammeProgressTableUpdateSteps.php.


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