ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilADTMultiTextDBBridge.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 protected function isValidADT(ilADT $a_adt): bool
24 {
25 return ($a_adt instanceof ilADTMultiText);
26 }
27
28 protected function readMultiRecord(ilDBStatement $a_set): void
29 {
30 $elements = array();
31
32 while ($row = $this->db->fetchAssoc($a_set)) {
33 $elements[] = $row[$this->getElementId()];
34 }
35
36 $this->getADT()->setTextElements($elements);
37 }
38
39 protected function prepareMultiInsert(): array
40 {
41 $res = [];
42 foreach ((array) $this->getADT()->getTextElements() as $element) {
43 $res[] = array($this->getElementId() => array("text", $element));
44 }
45
46 return $res;
47 }
48}
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:26
Interface ilDBStatement.
$res
Definition: ltiservices.php:69