ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMDLOMUpdateSteps Class Reference
+ Inheritance diagram for ilMDLOMUpdateSteps:
+ Collaboration diagram for ilMDLOMUpdateSteps:

Public Member Functions

 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 
 step_1 ()
 Add a column to the il_meta_general table to store the 'Aggregation Level' element. More...
 
 step_2 ()
 Add two columns to the il_meta_contribute table to store the descrption of the date and its language. More...
 
 step_3 ()
 Add two columns to the il_meta_annotation table to store the description of the date and its language. More...
 
 step_4 ()
 Add two columns to the il_meta_educational table to store the description of the typical learning time and its language. More...
 
 step_5 ()
 Add two columns to the il_meta_technical table to store the description of the duration and its language. More...
 
 step_6 ()
 Add a new table for the non-unique coverage. More...
 
 step_7 ()
 Add a new table for the non-unique metadata schema. More...
 
 step_8 ()
 Add a new table for the non-unique or-composite in requirements. More...
 
 step_9 ()
 Add a new table for the non-unique learning resource type. More...
 
 step_10 ()
 Add a new table for the non-unique intented end user role. More...
 
 step_11 ()
 Add a new table for the non-unique context. More...
 
 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Definition at line 21 of file class.ilMDLOMUpdateSteps.php.

Member Function Documentation

◆ prepare()

ilMDLOMUpdateSteps::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 25 of file class.ilMDLOMUpdateSteps.php.

25 : void
26 {
27 $this->db = $db;
28 }

References $db.

◆ step_1()

ilMDLOMUpdateSteps::step_1 ( )

Add a column to the il_meta_general table to store the 'Aggregation Level' element.

Definition at line 34 of file class.ilMDLOMUpdateSteps.php.

34 : void
35 {
36 if (!$this->db->tableColumnExists('il_meta_general', 'general_aggl')) {
37 $this->db->addTableColumn(
38 'il_meta_general',
39 'general_aggl',
40 [
41 'type' => ilDBConstants::T_TEXT,
42 'length' => 16,
43 ]
44 );
45 }
46 }

References ilDBConstants\T_TEXT.

◆ step_10()

ilMDLOMUpdateSteps::step_10 ( )

Add a new table for the non-unique intented end user role.

Definition at line 348 of file class.ilMDLOMUpdateSteps.php.

348 : void
349 {
350 if (!$this->db->tableExists('il_meta_end_usr_role')) {
351 $this->db->createTable(
352 'il_meta_end_usr_role',
353 [
354 'meta_end_usr_role_id' => [
355 'type' => ilDBConstants::T_INTEGER,
356 'notnull' => true,
357 'default' => 0
358 ],
359 'rbac_id' => [
360 'type' => ilDBConstants::T_INTEGER,
361 ],
362 'obj_id' => [
363 'type' => ilDBConstants::T_INTEGER,
364 ],
365 'obj_type' => [
366 'type' => ilDBConstants::T_TEXT,
367 'length' => 6
368 ],
369 'parent_type' => [
370 'type' => ilDBConstants::T_TEXT,
371 'length' => 16
372 ],
373 'parent_id' => [
374 'type' => ilDBConstants::T_INTEGER,
375 ],
376 'intended_end_user_role' => [
377 'type' => ilDBConstants::T_TEXT,
378 'length' => 16
379 ]
380 ]
381 );
382
383 $this->db->createSequence('il_meta_end_usr_role');
384 $this->db->addPrimaryKey('il_meta_end_usr_role', ['meta_end_usr_role_id']);
385 }
386 }

References ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

◆ step_11()

ilMDLOMUpdateSteps::step_11 ( )

Add a new table for the non-unique context.

Definition at line 391 of file class.ilMDLOMUpdateSteps.php.

391 : void
392 {
393 if (!$this->db->tableExists('il_meta_context')) {
394 $this->db->createTable(
395 'il_meta_context',
396 [
397 'meta_context_id' => [
398 'type' => ilDBConstants::T_INTEGER,
399 'notnull' => true,
400 'default' => 0
401 ],
402 'rbac_id' => [
403 'type' => ilDBConstants::T_INTEGER,
404 ],
405 'obj_id' => [
406 'type' => ilDBConstants::T_INTEGER,
407 ],
408 'obj_type' => [
409 'type' => ilDBConstants::T_TEXT,
410 'length' => 6
411 ],
412 'parent_type' => [
413 'type' => ilDBConstants::T_TEXT,
414 'length' => 16
415 ],
416 'parent_id' => [
417 'type' => ilDBConstants::T_INTEGER,
418 ],
419 'context' => [
420 'type' => ilDBConstants::T_TEXT,
421 'length' => 16
422 ]
423 ]
424 );
425
426 $this->db->createSequence('il_meta_context');
427 $this->db->addPrimaryKey('il_meta_context', ['meta_context_id']);
428 }
429 }

References ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

◆ step_2()

ilMDLOMUpdateSteps::step_2 ( )

Add two columns to the il_meta_contribute table to store the descrption of the date and its language.

Definition at line 52 of file class.ilMDLOMUpdateSteps.php.

52 : void
53 {
54 if (!$this->db->tableColumnExists('il_meta_contribute', 'c_date_descr')) {
55 $this->db->addTableColumn(
56 'il_meta_contribute',
57 'c_date_descr',
58 [
59 'type' => ilDBConstants::T_CLOB,
60 ]
61 );
62 }
63 if (!$this->db->tableColumnExists('il_meta_contribute', 'descr_lang')) {
64 $this->db->addTableColumn(
65 'il_meta_contribute',
66 'descr_lang',
67 [
68 'type' => ilDBConstants::T_TEXT,
69 'length' => 2
70 ]
71 );
72 }
73 }

References ilDBConstants\T_CLOB, and ilDBConstants\T_TEXT.

◆ step_3()

ilMDLOMUpdateSteps::step_3 ( )

Add two columns to the il_meta_annotation table to store the description of the date and its language.

Definition at line 79 of file class.ilMDLOMUpdateSteps.php.

79 : void
80 {
81 if (!$this->db->tableColumnExists('il_meta_annotation', 'a_date_descr')) {
82 $this->db->addTableColumn(
83 'il_meta_annotation',
84 'a_date_descr',
85 [
86 'type' => ilDBConstants::T_CLOB,
87 ]
88 );
89 }
90 if (!$this->db->tableColumnExists('il_meta_annotation', 'date_descr_lang')) {
91 $this->db->addTableColumn(
92 'il_meta_annotation',
93 'date_descr_lang',
94 [
95 'type' => ilDBConstants::T_TEXT,
96 'length' => 2
97 ]
98 );
99 }
100 }

References ilDBConstants\T_CLOB, and ilDBConstants\T_TEXT.

◆ step_4()

ilMDLOMUpdateSteps::step_4 ( )

Add two columns to the il_meta_educational table to store the description of the typical learning time and its language.

Definition at line 106 of file class.ilMDLOMUpdateSteps.php.

106 : void
107 {
108 if (!$this->db->tableColumnExists('il_meta_educational', 'tlt_descr')) {
109 $this->db->addTableColumn(
110 'il_meta_educational',
111 'tlt_descr',
112 [
113 'type' => ilDBConstants::T_CLOB,
114 ]
115 );
116 }
117 if (!$this->db->tableColumnExists('il_meta_educational', 'tlt_descr_lang')) {
118 $this->db->addTableColumn(
119 'il_meta_educational',
120 'tlt_descr_lang',
121 [
122 'type' => ilDBConstants::T_TEXT,
123 'length' => 2
124 ]
125 );
126 }
127 }

References ilDBConstants\T_CLOB, and ilDBConstants\T_TEXT.

◆ step_5()

ilMDLOMUpdateSteps::step_5 ( )

Add two columns to the il_meta_technical table to store the description of the duration and its language.

Definition at line 133 of file class.ilMDLOMUpdateSteps.php.

133 : void
134 {
135 if (!$this->db->tableColumnExists('il_meta_technical', 'duration_descr')) {
136 $this->db->addTableColumn(
137 'il_meta_technical',
138 'duration_descr',
139 [
140 'type' => ilDBConstants::T_CLOB,
141 ]
142 );
143 }
144 if (!$this->db->tableColumnExists('il_meta_technical', 'duration_descr_lang')) {
145 $this->db->addTableColumn(
146 'il_meta_technical',
147 'duration_descr_lang',
148 [
149 'type' => ilDBConstants::T_TEXT,
150 'length' => 2
151 ]
152 );
153 }
154 }

References ilDBConstants\T_CLOB, and ilDBConstants\T_TEXT.

◆ step_6()

ilMDLOMUpdateSteps::step_6 ( )

Add a new table for the non-unique coverage.

Definition at line 159 of file class.ilMDLOMUpdateSteps.php.

159 : void
160 {
161 if (!$this->db->tableExists('il_meta_coverage')) {
162 $this->db->createTable(
163 'il_meta_coverage',
164 [
165 'meta_coverage_id' => [
166 'type' => ilDBConstants::T_INTEGER,
167 'notnull' => true,
168 'default' => 0
169 ],
170 'rbac_id' => [
171 'type' => ilDBConstants::T_INTEGER,
172 ],
173 'obj_id' => [
174 'type' => ilDBConstants::T_INTEGER,
175 ],
176 'obj_type' => [
177 'type' => ilDBConstants::T_TEXT,
178 'length' => 6
179 ],
180 'parent_type' => [
181 'type' => ilDBConstants::T_TEXT,
182 'length' => 16
183 ],
184 'parent_id' => [
185 'type' => ilDBConstants::T_INTEGER,
186 ],
187 'coverage' => [
188 'type' => ilDBConstants::T_TEXT,
189 'length' => 4000
190 ],
191 'coverage_language' => [
192 'type' => ilDBConstants::T_TEXT,
193 'length' => 2,
194 'fixed' => true
195 ]
196 ]
197 );
198
199 $this->db->createSequence('il_meta_coverage');
200 $this->db->addPrimaryKey('il_meta_coverage', ['meta_coverage_id']);
201 }
202 }

References ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

◆ step_7()

ilMDLOMUpdateSteps::step_7 ( )

Add a new table for the non-unique metadata schema.

Definition at line 207 of file class.ilMDLOMUpdateSteps.php.

207 : void
208 {
209 if (!$this->db->tableExists('il_meta_meta_schema')) {
210 $this->db->createTable(
211 'il_meta_meta_schema',
212 [
213 'meta_meta_schema_id' => [
214 'type' => ilDBConstants::T_INTEGER,
215 'notnull' => true,
216 'default' => 0
217 ],
218 'rbac_id' => [
219 'type' => ilDBConstants::T_INTEGER,
220 ],
221 'obj_id' => [
222 'type' => ilDBConstants::T_INTEGER,
223 ],
224 'obj_type' => [
225 'type' => ilDBConstants::T_TEXT,
226 'length' => 6
227 ],
228 'parent_type' => [
229 'type' => ilDBConstants::T_TEXT,
230 'length' => 16
231 ],
232 'parent_id' => [
233 'type' => ilDBConstants::T_INTEGER,
234 ],
235 'meta_data_schema' => [
236 'type' => ilDBConstants::T_TEXT,
237 'length' => 16
238 ]
239 ]
240 );
241
242 $this->db->createSequence('il_meta_meta_schema');
243 $this->db->addPrimaryKey('il_meta_meta_schema', ['meta_meta_schema_id']);
244 }
245 }

References ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

◆ step_8()

ilMDLOMUpdateSteps::step_8 ( )

Add a new table for the non-unique or-composite in requirements.

Definition at line 250 of file class.ilMDLOMUpdateSteps.php.

250 : void
251 {
252 if (!$this->db->tableExists('il_meta_or_composite')) {
253 $this->db->createTable(
254 'il_meta_or_composite',
255 [
256 'meta_or_composite_id' => [
257 'type' => ilDBConstants::T_INTEGER,
258 'notnull' => true,
259 'default' => 0
260 ],
261 'rbac_id' => [
262 'type' => ilDBConstants::T_INTEGER,
263 ],
264 'obj_id' => [
265 'type' => ilDBConstants::T_INTEGER,
266 ],
267 'obj_type' => [
268 'type' => ilDBConstants::T_TEXT,
269 'length' => 6
270 ],
271 'parent_type' => [
272 'type' => ilDBConstants::T_TEXT,
273 'length' => 16
274 ],
275 'parent_id' => [
276 'type' => ilDBConstants::T_INTEGER,
277 ],
278 'type' => [
279 'type' => ilDBConstants::T_TEXT,
280 'length' => 16
281 ],
282 'name' => [
283 'type' => ilDBConstants::T_TEXT,
284 'length' => 32
285 ],
286 'min_version' => [
287 'type' => ilDBConstants::T_TEXT,
288 'length' => 255
289 ],
290 'max_version' => [
291 'type' => ilDBConstants::T_TEXT,
292 'length' => 255
293 ]
294 ]
295 );
296
297 $this->db->createSequence('il_meta_or_composite');
298 $this->db->addPrimaryKey('il_meta_or_composite', ['meta_or_composite_id']);
299 }
300 }

References ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

◆ step_9()

ilMDLOMUpdateSteps::step_9 ( )

Add a new table for the non-unique learning resource type.

Definition at line 305 of file class.ilMDLOMUpdateSteps.php.

305 : void
306 {
307 if (!$this->db->tableExists('il_meta_lr_type')) {
308 $this->db->createTable(
309 'il_meta_lr_type',
310 [
311 'meta_lr_type_id' => [
312 'type' => ilDBConstants::T_INTEGER,
313 'notnull' => true,
314 'default' => 0
315 ],
316 'rbac_id' => [
317 'type' => ilDBConstants::T_INTEGER,
318 ],
319 'obj_id' => [
320 'type' => ilDBConstants::T_INTEGER,
321 ],
322 'obj_type' => [
323 'type' => ilDBConstants::T_TEXT,
324 'length' => 6
325 ],
326 'parent_type' => [
327 'type' => ilDBConstants::T_TEXT,
328 'length' => 16
329 ],
330 'parent_id' => [
331 'type' => ilDBConstants::T_INTEGER,
332 ],
333 'learning_resource_type' => [
334 'type' => ilDBConstants::T_TEXT,
335 'length' => 32
336 ]
337 ]
338 );
339
340 $this->db->createSequence('il_meta_lr_type');
341 $this->db->addPrimaryKey('il_meta_lr_type', ['meta_lr_type_id']);
342 }
343 }

References ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Field Documentation

◆ $db

ilDBInterface ilMDLOMUpdateSteps::$db
protected

Definition at line 23 of file class.ilMDLOMUpdateSteps.php.

Referenced by prepare().


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