ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilADTLocationDBBridge.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 ilADTLocation);
26 }
27
28 public function readRecord(array $a_row): void
29 {
30 $this->getADT()->setLongitude((float) $a_row[$this->getElementId() . "_long"]);
31 $this->getADT()->setLatitude((float) $a_row[$this->getElementId() . "_lat"]);
32 $this->getADT()->setZoom($a_row[$this->getElementId() . "_zoom"]);
33 }
34
35 public function prepareInsert(array &$a_fields): void
36 {
37 $a_fields[$this->getElementId() . "_long"] = array("float", $this->getADT()->getLongitude());
38 $a_fields[$this->getElementId() . "_lat"] = array("float", $this->getADT()->getLatitude());
39 $a_fields[$this->getElementId() . "_zoom"] = array("integer", $this->getADT()->getZoom());
40 }
41
42 public function supportsDefaultValueColumn(): bool
43 {
44 return false;
45 }
46}
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:26