ILIAS  release_8 Revision v8.24
class.ilADTLocationDBBridge.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 ilADTLocation);
10 }
11
12 public function readRecord(array $a_row): void
13 {
14 $this->getADT()->setLongitude((float) $a_row[$this->getElementId() . "_long"]);
15 $this->getADT()->setLatitude((float) $a_row[$this->getElementId() . "_lat"]);
16 $this->getADT()->setZoom($a_row[$this->getElementId() . "_zoom"]);
17 }
18
19 public function prepareInsert(array &$a_fields): void
20 {
21 $a_fields[$this->getElementId() . "_long"] = array("float", $this->getADT()->getLongitude());
22 $a_fields[$this->getElementId() . "_lat"] = array("float", $this->getADT()->getLatitude());
23 $a_fields[$this->getElementId() . "_zoom"] = array("integer", $this->getADT()->getZoom());
24 }
25
26 public function supportsDefaultValueColumn(): bool
27 {
28 return false;
29 }
30}
ADT DB bridge base class.
getElementId()
Get element id.
supportsDefaultValueColumn()
true if table storage relies on the default 'value' column
prepareInsert(array &$a_fields)
Prepare ADT values for insert.
readRecord(array $a_row)
Import DB values to ADT.
ADT base class.
Definition: class.ilADT.php:12