ILIAS  release_8 Revision v8.24
class.ilADTMultiTextDBBridge.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6{
7 protected function isValidADT(ilADT $a_adt): bool
8 {
9 return ($a_adt instanceof ilADTMultiText);
10 }
11
12 protected function readMultiRecord(ilDBStatement $a_set): void
13 {
14 $elements = array();
15
16 while ($row = $this->db->fetchAssoc($a_set)) {
17 $elements[] = $row[$this->getElementId()];
18 }
19
20 $this->getADT()->setTextElements($elements);
21 }
22
23 protected function prepareMultiInsert(): array
24 {
25 $res = [];
26 foreach ((array) $this->getADT()->getTextElements() as $element) {
27 $res[] = array($this->getElementId() => array("text", $element));
28 }
29
30 return $res;
31 }
32}
getElementId()
Get element id.
readMultiRecord(ilDBStatement $a_set)
Import record-rows from sub-table.
prepareMultiInsert()
Build insert-fields for each "value".
ADT base class.
Definition: class.ilADT.php:12
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69