ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilPDFGenerationDB90.php
Go to the documentation of this file.
1 <?php
2 
20 {
21  protected ilDBInterface $db;
22 
23  public function prepare(ilDBInterface $db): void
24  {
25  $this->db = $db;
26  }
27 
28  public function step_1(): void
29  {
30  if ($this->db->tableExists('pdfgen_conf')) {
31  $this->db->dropTable('pdfgen_conf');
32  }
33  }
34 
35  public function step_2(): void
36  {
37  if ($this->db->tableExists('pdfgen_map')) {
38  $this->db->dropTable('pdfgen_map');
39  }
40  }
41  public function step_3(): void
42  {
43  if ($this->db->tableExists('pdfgen_purposes')) {
44  $this->db->dropTable('pdfgen_purposes');
45  }
46  }
47 
48  public function step_4(): void
49  {
50  if ($this->db->tableExists('pdfgen_renderer')) {
51  $this->db->dropTable('pdfgen_renderer');
52  }
53  }
54  public function step_5(): void
55  {
56  if ($this->db->tableExists('pdfgen_renderer_avail')) {
57  $this->db->dropTable('pdfgen_renderer_avail');
58  }
59  }
60  public function step_6(): void
61  {
62  if ($this->db->tableExists('pdfgen_conf_seq')) {
63  $this->db->dropTable('pdfgen_conf_seq');
64  }
65  }
66 
67  public function step_7(): void
68  {
69  if ($this->db->tableExists('pdfgen_map_seq')) {
70  $this->db->dropTable('pdfgen_map_seq');
71  }
72  }
73  public function step_8(): void
74  {
75  if ($this->db->tableExists('pdfgen_purposes_seq')) {
76  $this->db->dropTable('pdfgen_purposes_seq');
77  }
78  }
79 
80  public function step_9(): void
81  {
82  if ($this->db->tableExists('pdfgen_renderer_seq')) {
83  $this->db->dropTable('pdfgen_renderer_seq');
84  }
85  }
86  public function step_10(): void
87  {
88  if ($this->db->tableExists('pdfgen_renderer_avail_seq')) {
89  $this->db->dropTable('pdfgen_renderer_avail_seq');
90  }
91  }
92 
93  public function step_11(): void
94  {
95  $this->db->manipulateF('DELETE FROM il_object_subobj WHERE subobj = %s',
96  array('text'),
97  array('pdfg')
98  );
99  }
100 
101  public function step_12(): void
102  {
103  $this->db->manipulateF('DELETE FROM il_object_def WHERE id = %s',
104  array('text'),
105  array('pdfg')
106  );
107  }
108 
109  public function step_13(): void
110  {
111  $res = $this->db->queryF(
112  'SELECT obj_id FROM object_data WHERE type = %s AND title = %s',
113  array('text', 'text'),
114  array('typ', 'pdfg')
115  );
116  $row = $this->db->fetchAssoc($res);
117 
118  if (is_array($row) && isset($row['obj_id'])) {
119  $obj_id = $row['obj_id'];
120 
121  $this->db->manipulateF(
122  'DELETE FROM rbac_ta WHERE typ_id = %s',
123  array('integer'),
124  array($obj_id)
125  );
126 
127  $this->db->manipulateF(
128  'DELETE FROM object_data WHERE obj_id = %s',
129  array('integer'),
130  array($obj_id)
131  );
132  }
133  }
134 
135  public function step_14(): void
136  {
137  $this->db->manipulateF('DELETE FROM object_data WHERE type = %s',
138  array('text'),
139  array('pdfg')
140  );
141  }
142 }
$res
Definition: ltiservices.php:69
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...