ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPortfolioDBUpdateSteps.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\Portfolio\Setup;
20
25{
26 protected \ilDBInterface $db;
27
28 public function prepare(\ilDBInterface $db): void
29 {
30 $this->db = $db;
31 }
32
33 public function step_1(): void
34 {
35 $db = $this->db;
36 if (!$db->tableExists('prtf_role_assignment')) {
37 $fields = [
38 'role_id' => [
39 'type' => 'integer',
40 'length' => 4,
41 'notnull' => true,
42 'default' => 0
43 ],
44 'template_ref_id' => [
45 'type' => 'integer',
46 'length' => 4,
47 'notnull' => true,
48 'default' => 0
49 ]
50 ];
51 $db->createTable('prtf_role_assignment', $fields);
52 $db->addPrimaryKey('prtf_role_assignment', ['role_id', 'template_ref_id']);
53 }
54 }
55
56 public function step_2(): void
57 {
58 $db = $this->db;
60 "DELETE FROM usr_portfolio_page WHERE " .
61 " type = %s",
62 ["integer"],
63 [2]
64 );
65 }
66}
prepare(\ilDBInterface $db)
Prepare the execution of the steps.
Interface ilDBInterface.
tableExists(string $table_name)
manipulateF(string $query, array $types, array $values)
createTable(string $table_name, array $fields, bool $drop_table=false, bool $ignore_erros=false)
addPrimaryKey(string $table_name, array $primary_keys)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: class.Agent.php:19