ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDataCollectionDBUpdateSteps10.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 protected ilDBInterface $db;
24
25 public function prepare(ilDBInterface $db): void
26 {
27 $this->db = $db;
28 }
29
30 public function step_1(): void
31 {
32 $stmt = $this->db->queryF(
33 'SELECT il_dcl_field.*, area.value As text_area FROM il_dcl_field ' .
34 'LEFT JOIN il_dcl_field_prop AS lenght ON il_dcl_field.id = lenght.field_id AND lenght.name = %s' .
35 'LEFT JOIN il_dcl_field_prop AS area ON il_dcl_field.id = area.field_id AND area.name = %s' .
36 'WHERE il_dcl_field.datatype_id = %s AND lenght.value IS NULL',
37 [ilDBConstants::T_TEXT, ilDbConstants::T_TEXT, ilDbConstants::T_INTEGER],
39 );
40
41 while ($row = $this->db->fetchAssoc($stmt)) {
42 $this->db->insert(
43 'il_dcl_field_prop',
44 [
45 'id' => [ilDBConstants::T_INTEGER, $this->db->nextId('il_dcl_field_prop')],
46 'field_id' => [ilDBConstants::T_INTEGER, $row['id']],
48 'value' => [ilDBConstants::T_TEXT, ($row['text_area'] === '1') ? '4000' : '200'],
49 ]
50 );
51 }
52
53 $this->db->manipulateF(
54 "DELETE FROM il_dcl_field_prop WHERE name = %s",
56 ['text_area']
57 );
58 }
59}
const PROP_LENGTH
General properties.
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...