public function searchOffers($mro) { try { //echo 'LMwebSoapClient search offer'; $result = $this->sc->searchOffers(array('mro' => $mro->getParamsAsArray()))->return; } catch (Exception $ex) { echo $ex->getMessage(); return null; } if ($result->offers->info == "NOHIT") { Template::errorTemplate("Keine Treffer gefunden"); return null; } if ($result->offers->offers != 0) { $cities = array(); if (is_array($result->offers->cityList)) { foreach ($result->offers->cityList as $value) { $city = new City($value->id, $value->minPrice, $value->name); $cities[$city->getId()] = $city; } } else { $city = new City($result->offers->cityList->id, $result->offers->cityList->minPrice, $result->offers->cityList->name); $cities[$city->getId()] = $city; } $offers = array(); if (is_array($result->offers->offersList)) { foreach ($result->offers->offersList as $value) { $offer = new Offer(); $offer->setParamsByArray($value); $offer->setCity($cities[$offer->getCity()]); array_push($offers, $offer); } } else { $offer = new Offer(); $offer->setParamsByArray($result->offers->offersList); $offer->setCity($cities[$offer->getCity()]); array_push($offers, $offer); } } else { Template::errorTemplate("Keine Treffer gefunden"); return null; } return $offers; }
/** * Declares an association between this object and a City object. * * @param City $v * @return CityInfo The current object (for fluent API support) * @throws PropelException */ public function setCity(City $v = null) { if ($v === null) { $this->setCityId(NULL); } else { $this->setCityId($v->getId()); } $this->aCity = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the City object, it will not be re-added. if ($v !== null) { $v->addCityInfo($this); } return $this; }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param City $value A City object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(City $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null self::$instances[$key] = $obj; } }
/** * update one city in the database * * @author Jonathan Sandoval <*****@*****.**> * @param City $city The city to update * @return boolean if was possible to update */ static function updateCity($city = null) { if ($city === null) { return false; } $tableCity = DatabaseManager::getNameTable('TABLE_CITY'); $id = $city->getId(); $idState = $city->getIdState(); $name = $city->getName(); $query = "UPDATE {$tableCity}\n SET name = '{$name}', idState = {$idState}\n WHERE {$tableCity}.id = {$id}"; return DatabaseManager::singleAffectedRow($query); }
private function createCity() { $city = new City(4330); if (!$city->getId()) { $city->setZip(4330); $city->setCity("Aalgaard"); $city->commit(); } }
for ($i0 = 0; isset($r['0.' . $i0]); $i0++) { $courtoffice[$i0] = @$r['0.' . $i0 . '']; } $jurisdiction = @$r['1']; $courtofappeal = @$r['2']; $sessions = array(); for ($i0 = 0; isset($r['3.' . $i0]); $i0++) { $sessions[$i0] = array('id' => @$r['3.' . $i0 . '.0'], 'Session' => @$r['3.' . $i0 . '.0'], 'scheduled' => @$r['3.' . $i0 . '.2'], 'panel' => @$r['3.' . $i0 . '.3']); $sessions[$i0]['judge'] = array(); for ($i1 = 0; isset($r['3.' . $i0 . '.1.' . $i1]); $i1++) { $sessions[$i0]['judge'][$i1] = @$r['3.' . $i0 . '.1.' . $i1 . '']; } } $City = new City($ID, $courtoffice, $jurisdiction, $courtofappeal, $sessions); if ($City->save() !== false) { die('ok:' . $_SERVER['PHP_SELF'] . '?City=' . urlencode($City->getId())); } else { die(''); } exit; // do not show the interface } $buttons = ""; if (isset($_REQUEST['new'])) { $new = true; } else { $new = false; } if (isset($_REQUEST['edit']) || $new) { $edit = true; } else {