ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilADTLocationDBBridge.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 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 }
getElementId()
Get element id.
ADT base class.
Definition: class.ilADT.php:11
ADT DB bridge base class.