ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilADTLocationDBBridge.php
Go to the documentation of this file.
1<?php
2
3require_once "Services/ADT/classes/Bridges/class.ilADTDBBridge.php";
4
6{
7 protected function isValidADT(ilADT $a_adt)
8 {
9 return ($a_adt instanceof ilADTLocation);
10 }
11
12
13 public function readRecord(array $a_row)
14 {
15 $this->getADT()->setLongitude($a_row[$this->getElementId() . "_long"]);
16 $this->getADT()->setLatitude($a_row[$this->getElementId() . "_lat"]);
17 $this->getADT()->setZoom($a_row[$this->getElementId() . "_zoom"]);
18 }
19
20 public function prepareInsert(array &$a_fields)
21 {
22 $a_fields[$this->getElementId() . "_long"] = array("float", $this->getADT()->getLongitude());
23 $a_fields[$this->getElementId() . "_lat"] = array("float", $this->getADT()->getLatitude());
24 $a_fields[$this->getElementId() . "_zoom"] = array("integer", $this->getADT()->getZoom());
25 }
26
27 public function supportsDefaultValueColumn() : bool
28 {
29 return false;
30 }
31}
An exception for terminatinating execution or to throw for unit testing.
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.
isValidADT(ilADT $a_adt)
Check if given ADT is valid.
readRecord(array $a_row)
Import DB values to ADT.
ADT base class.
Definition: class.ilADT.php:12