ILIAS  release_8 Revision v8.24
ilStudyProgrammeAssignmentTableUpdateSteps.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22{
23 public const TABLE_NAME = 'prg_usr_assignments';
24
25 protected ilDBInterface $db;
26
27 public function prepare(ilDBInterface $db): void
28 {
29 $this->db = $db;
30 }
31
32 public function step_1(): void
33 {
34 $column_name = 'assigned_manually';
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 'default' => 0,
44 'notnull' => false
45 ]
46 );
47 }
48
49 $query = 'UPDATE ' . self::TABLE_NAME
50 . ' JOIN object_data ON last_change_by = object_data.obj_id'
51 . ' SET ' . $column_name . ' = 1'
52 . ' WHERE type = "usr";'
53 ;
54 $this->db->manipulate($query);
55 }
56}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$query