本文整理汇总了PHP中Place::saveToMongoDB方法的典型用法代码示例。如果您正苦于以下问题:PHP Place::saveToMongoDB方法的具体用法?PHP Place::saveToMongoDB怎么用?PHP Place::saveToMongoDB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Place
的用法示例。
在下文中一共展示了Place::saveToMongoDB方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Place
$form = $entry->addChild('Form');
$form->addAttribute('level','exact');
*/
// CREATE INSERT IN DB
$currentPlace = new Place();
$currentPlace->title = $streetName;
$currentPlace->content = $streetHisto;
$currentPlace->origin = $origin;
$currentPlace->filesourceTitle = $fileTitle;
$currentPlace->licence = $licence;
// YakCat
$cat = array("GEOLOCALISATION#RUE", "GEOLOCALISATION");
$currentPlace->setYakCat($cat);
$currentPlace->zone = 1;
$locationQuery = $streetName . ',Paris, France';
$res = $currentPlace->saveToMongoDB($locationQuery, $debug, $updateFlag);
foreach ($res as $k => $v) {
if (isset($v)) {
$results[$k] += $v;
}
}
$results['parse']++;
}
}
$results['row']++;
$row++;
}
fclose($handle);
}
//$res = $ontolgyXML->asXML($outputFile);
$currentPlace->prettyLog($results);
示例2: linkToPlace
function linkToPlace($locationQuery, $debug)
{
$newPlace = new Place();
$resPlace = array('duplicate' => 0, 'insert' => 0, 'locErr' => 0, 'update' => 0, 'callGMAP' => 0, "error" => 0, 'record' => array());
// we try first on the name of the place
if (!empty($this->placeName)) {
$theString2Search = $this->placeName;
} elseif (!empty($this->address)) {
// but if no place name, we try the address
$theString2Search = $this->address;
}
$result = $newPlace->getDuplicated($theString2Search, $this->zone);
if (empty($doublon)) {
if (!empty($result['location'])) {
// we set the location without calling gmap
$this->location = $result['location'];
}
$this->placeid = $result['_id'];
$this->status = 1;
// here it must be 1 because of the query
$this->print = 1;
$this->address = $result['title'];
} else {
print "{$this->title} : Place doesn't exist in db (creation).<br>";
$newPlace->title = $this->placeName;
$newPlace->origin = $this->origin;
$newPlace->filesourceTitle = $this->filesourceTitle;
$newPlace->licence = $this->licence;
$cat = array("GEOLOCALISATION", "GEOLOCALISATION#YAKDICO");
$newPlace->setYakCat($cat);
$newPlace->zone = $this->zone;
$resPlace = $newPlace->saveToMongoDB($locationQuery, $debug);
if (!empty($resPlace['error'])) {
echo $resPlace['error'];
echo '<br><b>BATCH FAILLED</b><br>Place creation failed';
exit;
}
$theNewPlace = $resPlace['record'];
$this->placeid = $theNewPlace['_id'];
$this->location = $theNewPlace['location'];
$this->address = $theNewPlace['formatted_address'];
$this->status = $theNewPlace['status'];
// if gmap did not work we have a status 10
if ($this->status != 1) {
$this->print = 0;
} else {
$this->print = 1;
}
}
return $resPlace;
}
示例3: elseif
$currentPlace->setYakCat(array("CULTURE#MEDIATHEQUE"));
} elseif (stristr($data[1], "Planétarium")) {
//echo "Planétarium : $data[1] <br/>";
$currentPlace->setYakCat(array('CULTURE#PLANETARIUM'));
$currentPlace->yakTagChildren();
} elseif (stristr($data[1], "Aquarium")) {
//echo "Aquarium : $data[1] <br/>";
$currentPlace->setYakCat(array('CULTURE#AQUARIUM'));
$currentPlace->yakTagChildren();
} else {
//echo "autres (musée) : $data[1] <br/>";
$currentPlace->setYakCat(array('CULTURE#MUSEE'));
}
$locationQuery = $query = $currentPlace->title . ' ' . $currentPlace->address["street"] . ' ' . $currentPlace->address["zipcode"] . ' ' . $currentPlace->address["city"] . ', ' . $currentPlace->address["country"];
print '<hr><b>' . $currentPlace->title . '</b><br>';
switch ($currentPlace->saveToMongoDB($locationQuery, $debug, true, true)) {
case '1':
$insert++;
$locError++;
break;
case '2':
print "updated <br>";
$update++;
break;
case '3':
print "doublon <br>";
$doublon++;
break;
default:
print "insert (1 call to gmap)<br>";
$insert++;
示例4: Place
$jardin = json_decode($jardinJSON[0], 1);
$currentPlace = new Place();
$currentPlace->title = $jardin['name'];
echo $jardin['name'] . "<br>";
$currentPlace->filesourceTitle = $fileTitle;
$currentPlace->location->lat = $jardin['lat'];
$currentPlace->location->lng = $jardin['lng'];
$currentPlace->licence = $licence;
$currentPlace->origin = $origin;
$currentPlace->address->street = $jardin['address'];
$currentPlace->address->state = "Paris";
$currentPlace->address->area = "Ile-de-France";
$currentPlace->address->zip = $jardin['zipcode'];
$currentPlace->address->city = "Paris";
$currentPlace->address->country = "France";
$currentPlace->contact->opening = "http://parcsetjardins.equipement.paris.fr/tousleshoraires";
$currentPlace->setTagOutdoor();
$cat = array("#GEOLOCALISATION", "GEOLOCALISATION#YAKDICO", "LOISIR", "LOISIR#ESPACEVERT");
$currentPlace->setYakCat($cat);
$currentPlace->setZone("PARIS");
$res = $currentPlace->saveToMongoDB('', $debug, $updateFlag);
foreach ($res as $k => $v) {
if (isset($v)) {
$results[$k] += $v;
}
}
$results['parse']++;
$results['row']++;
$row++;
}
$currentPlace->prettyLog($results);
示例5: foreach
if ($data[2] == "Organisme d'Arts plastiques") {
$cat[] = "CULTURE#EXPOSITION";
} else {
if (preg_match("/archives/i", $data[20])) {
$cat[] = "EDUCATION#ARCHIVE";
}
}
}
}
}
}
}
}
$currentPlace->setYakCat($cat);
echo '<br><b>OK, lets insert:</b>' . $title;
$res = $currentPlace->saveToMongoDB($queryGMAP, $debug, $updateFlag);
foreach ($res as $k => $v) {
if (isset($v)) {
$results[$k] += $v;
}
}
$results['parse']++;
}
$results['row']++;
$row++;
}
fclose($handle);
}
$currentPlace->prettyLog($results);
?>
</body>
示例6:
$currentPlace->licence = $licence;
$currentPlace->formatted_address = $Org_Commune . ", France,";
$currentPlace->setLocation($latitude, $longitude);
$currentPlace->status = 1;
$currentPlace->zone = 15;
$currentPlace->address->city = $Org_Commune;
$currentPlace->address->area = "Bretagne";
$currentPlace->address->country = "France";
$currentPlace->address->zip = $Org_Commune_cp;
$currentPlace->setYakCat($cat);
$currentPlace->outGoingLink = $Site_Internet;
$currentPlace->access = 2;
$currentPlace->contact->web = $Site_Internet;
$currentPlace->user = 0;
$currentPlace->filesourceId = '50e42ac09bab884612000000';
$newPlace = $currentPlace->saveToMongoDB('', 1, $updateFlag);
//info except info->eventDate since it needs arrays and conditions
echo '<br><b>PLACE:</b> <br>';
var_dump($newPlace);
$datpar = $Date[3]['annee'] . "-" . $Date[3]['mois'] . "-" . $Date[3]['jour'];
//print_r($info);
//print_r($eventDate);
$info->status = 1;
$info->title = $Titre;
if ($Corps_Debut != "" || $Corps_Descriptif != "" || $Corps_Finorps != "") {
$info->content = $Corps_Debut . " " . $Corps_Descriptif . " " . $Corps_Fin;
}
$info->heat = 80;
$info->location->lat = $latitude;
$info->location->lng = $longitude;
$info->originLink = $originLink;