当前位置: 首页>>代码示例>>PHP>>正文


PHP Place::setZone方法代码示例

本文整理汇总了PHP中Place::setZone方法的典型用法代码示例。如果您正苦于以下问题:PHP Place::setZone方法的具体用法?PHP Place::setZone怎么用?PHP Place::setZone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Place的用法示例。


在下文中一共展示了Place::setZone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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);
开发者ID:rebe100x,项目名称:YAKREP,代码行数:31,代码来源:jardinsparis.php

示例2: elseif

     } else {
         $content = "";
     }
 } elseif (!empty($data[5])) {
     $title = $data[5];
     $content = "";
 }
 $place->title = $title;
 $place->content = $content;
 $place->origin = $origin;
 $place->filesourceTitle = $fileTitle;
 $place->licence = $licence;
 $place->setTel($data[16], "tel");
 $place->setMail($data[18]);
 $place->setWeb($data[19]);
 $place->setZone("MONTPELLIER");
 // YakCat
 $cat = array("GEOLOCALISATION", "GEOLOCALISATION#YAKDICO");
 $place->setYakCat($cat);
 $place->setYakCat(array($data[9]));
 if (!empty($data[33]) || !empty($data[34]) || !empty($data[20])) {
     $place->setTagCarPark();
 }
 $transportation = "";
 if (!empty($data[37])) {
     $transportation = "Tram: " . $data[37] . "<br>";
 }
 if (!empty($data[38])) {
     $transportation = "Bus: " . $data[37];
 }
 $place->contact->transportation = $transportation;
开发者ID:rebe100x,项目名称:YAKREP,代码行数:31,代码来源:etsPublicsMtpl.php

示例3: array

         $currentPlace->filesourceTitle = $fileTitle;
         $currentPlace->licence = $licence;
         $currentPlace->setTagIndoor();
         // YakCat
         $cat = array("CULTURE", "GEOLOCALISATION", "GEOLOCALISATION#YAKDICO", "CULTURE#CINEMA");
         $currentPlace->setYakCat($cat);
         if (substr(trim($data[7]), 0, 2) == "75") {
             $zoneName = "PARIS";
         } elseif (substr(trim($data[7]), 0, 2) == "34") {
             $zoneName = "MONTPELLIER";
         } else {
             $results['rejected']++;
             $results['row']++;
             continue;
         }
         $currentPlace->setZone($zoneName);
         print "<b>{$currentPlace->title}</b><br>";
         $locationQuery = $query = $data[4] . " " . $data[5] . ' ' . $data[7] . ' ' . $data[6] . ', France';
         //echo $locationQuery;
         $res = $currentPlace->saveToMongoDB($locationQuery, $debug, $updateFlag);
         foreach ($res as $k => $v) {
             if (isset($v)) {
                 $results[$k] += $v;
             }
         }
         $results['parse']++;
     }
     $results['row']++;
     $row++;
 }
 fclose($handle);
开发者ID:rebe100x,项目名称:YAKREP,代码行数:31,代码来源:cinemaFrance.php

示例4: trim

     echo "<br>" . $data[0] . " " . $data[4] . " =><b>Not in France</b>";
     $results['rejected']++;
     $results['row']++;
     continue;
 }
 // if no valid address, we skip
 $street = trim($data[6] . " " . $data[7] . " " . $data[8] . " " . $data[9]);
 if (strlen($street) == 0) {
     echo "<br>" . $data[0] . " <b>no address</b> " . $street;
     $results['rejected']++;
     $results['row']++;
     continue;
 }
 // If zone isn't Paris or Montpellier, skip
 if (preg_match("/paris/i", $data[14])) {
     $currentPlace->setZone("PARIS");
 } else {
     if (preg_match("/montpellier/i", $data[14])) {
         $currentPlace->setZone("MONTPELLIER");
     } else {
         echo "<br>" . $data[0] . " <b>not in your zone</b> ";
         $results['rejected']++;
         $results['row']++;
         continue;
     }
 }
 /* title logic :
 				- we take field 38 if not empty
 				- if 38 is empty , we take field 0 but first par goes in title and second goes in content
 			*/
 $title = "";
开发者ID:rebe100x,项目名称:YAKREP,代码行数:31,代码来源:offreCulturelle.php


注:本文中的Place::setZone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。