ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilADTLocationDBBridge.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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 }
getElementId()
Get element id.
ADT base class.
Definition: class.ilADT.php:25
ADT DB bridge base class.