Example #1
0
 public static function factory(Storage $storage, $row)
 {
     $ort = new Ort($storage);
     $ort->setOrtID($row["ortid"]);
     $ort->setPLZ($row["plz"]);
     $ort->setLabel($row["label"]);
     $ort->setLatitude($row["latitude"]);
     $ort->setLongitude($row["longitude"]);
     $ort->setStateID($row["stateid"]);
     return $ort;
 }
Example #2
0
 public function searchOrt($plz, $label, $stateid)
 {
     $sql = "SELECT `ortid`, `plz`, `label`, `latitude`, `longitude`, `stateid` FROM `orte` WHERE `plz` = '" . $this->escape($plz) . "' AND `label` = '" . $this->escape($label) . "' AND `stateid` = " . intval($stateid);
     $result = $this->getResult($sql, array($this, "parseOrt"));
     if ($result->getCount() > 0) {
         return $result->fetchRow();
     }
     $ort = new Ort($this);
     $ort->setPLZ($plz);
     $ort->setLabel($label);
     $ort->setStateID($stateid);
     $ort->save();
     return $ort;
 }