ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilADTMultiTextDBBridge.php
Go to the documentation of this file.
1<?php
2
3require_once "Services/ADT/classes/Bridges/class.ilADTMultiDBBridge.php";
4
6{
7 protected function isValidADT(ilADT $a_adt)
8 {
9 return ($a_adt instanceof ilADTMultiText);
10 }
11
12 protected function readMultiRecord($a_set)
13 {
14 global $DIC;
15
16 $ilDB = $DIC['ilDB'];
17
18 $elements = array();
19
20 while ($row = $ilDB->fetchAssoc($a_set)) {
21 $elements[] = $row[$this->getElementId()];
22 }
23
24 $this->getADT()->setTextElements($elements);
25 }
26
27 protected function prepareMultiInsert()
28 {
29 $res = array();
30
31 foreach ((array) $this->getADT()->getTextElements() as $element) {
32 $res[] = array($this->getElementId() => array("text", $element));
33 }
34
35 return $res;
36 }
37}
An exception for terminatinating execution or to throw for unit testing.
getElementId()
Get element id.
readMultiRecord($a_set)
Import record-rows from sub-table.
isValidADT(ilADT $a_adt)
Check if given ADT is valid.
prepareMultiInsert()
Build insert-fields for each "value".
ADT base class.
Definition: class.ilADT.php:12
global $DIC
Definition: goto.php:24
foreach($_POST as $key=> $value) $res
global $ilDB