ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilADTMultiTextDBBridge.php
Go to the documentation of this file.
1 <?php
2 
3 declare(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 }
$res
Definition: ltiservices.php:69
getElementId()
Get element id.
ADT base class.
Definition: class.ilADT.php:11
readMultiRecord(ilDBStatement $a_set)