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


PHP Info::saveToMongoDB方法代码示例

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


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

示例1: foreach

                 $info->zone = $zone;
                 $info->placeName = $currentPlace->title;
                 // Duplicate info for each date
                 foreach ($location->dates as $date) {
                     $eventDate = array();
                     $dateDay = DateTime::createFromFormat('Y-m-d', $date->date);
                     $dateFrom = DateTime::createFromFormat('Y-m-d H:i:s', $date->date . " " . $date->timeStart);
                     $eventDate['dateFrom'] = new MongoDate(date_timestamp_get($dateFrom));
                     $dateEnd = DateTime::createFromFormat('Y-m-d H:i:s', $date->date . " " . $date->timeEnd);
                     $eventDate['dateEnd'] = new MongoDate(date_timestamp_get($dateEnd));
                     // hreventdate format example 2012-04-13 21:30
                     $eventDate['hreventdate'] = $date->date . " - " . mb_substr($date->timeStart, 0, -3);
                     $info->eventDate = $eventDate;
                     $dateEndPrint = strtotime("+7 days", date_timestamp_get($dateEnd));
                     $info->dateEndPrint = new MongoDate($dateEndPrint);
                     $res = $info->saveToMongoDB('', $debug, $updateFlag);
                 }
                 /* End info insertion in mongodb */
             }
             /* End place insertion in mongodb */
             $results['parse']++;
             $results['row']++;
             $row++;
         }
     }
     print_debug("<hr />");
 }
 // Temporary break after 15 insertions
 if ($row > 15) {
     break;
 }
开发者ID:rebe100x,项目名称:YAKREP,代码行数:31,代码来源:batch.php

示例2: gmmktime

     $info->licence = $licence;
     $info->pubDate = gmmktime();
     $info->dateEndPrint = gmmktime(0, 0, 0, 9, 1, 2013);
     $info->heat = 1;
     $cat = array("TRANSPORT#STATION", "STATISTIQUES");
     $info->setYakCat($cat);
     $info->status = 1;
     $info->print = 1;
     $info->yakType = 3;
     $info->setZone("PARIS");
     $info->placeName = 'station ' . $title;
     // NOTE, since it goes in the YAKDICO, we need to add the word 'station' before. If we do not all words 'CHATELET' will be detected by semantic
     $locationQuery = 'station ' . $data[2] . ' ' . $title . ' ' . $zip . ' ' . $city . ', France';
     $cat = array("TRANSPORT#STATION", "STATISTIQUES");
     $info->setYakCat($cat);
     $res = $info->saveToMongoDB($locationQuery, $debug, $updateFlag);
     if (!empty($res['error'])) {
         echo $res['error'];
         echo '<br><b>BATCH FAILLED</b><br>';
         exit;
     }
     foreach ($res as $k => $v) {
         if (isset($v)) {
             $results[$k] += $v;
         }
     }
 } else {
     $results['rejected']++;
     $results['row']++;
     echo 'rejected' . $data[10];
 }
开发者ID:rebe100x,项目名称:YAKREP,代码行数:31,代码来源:stationsMetroRER.php

示例3: MongoDate

            $info->user = 0;
            $info->zone = 15;
            $info->address = $Nom . " " . $Org_Commune;
            $dateUpdatedAt = DateTime::createFromFormat('Y-m-d', $datpar);
            $info->pubDate = new MongoDate($dateUpdatedAt->getTimestamp());
            $info->eventDate = $eventDateTotal;
            echo '<br>dateEndPrint' . date('Y m d', $dateEndPrint);
            $info->dateEndPrint = new MongoDate($dateEndPrint);
            $info->print = 1;
            $info->outGoingLink = $url;
            $info->access = 2;
            $info->yakType = 2;
            if ($photo[0]['Path'] != '') {
                $info->thumb = "/thumb/" . createImgThumb(ltrim($photo[0][Path], "/"), $conf);
            }
            $info->setYakCatOuest($cat);
            $info->filesourceId = '50e42ac09bab884612000000';
            $info->filesourceTitle = $fileTitle;
            $info->licence = $licence;
            $info->placeId = $newPlace['record']['_id'];
            $info->saveToMongoDB("", 1, $updateFlag);
            echo '<br><b>INFO:</b> <br>';
            print_r($info);
            //------------------------------
            unset($Date_ev);
            unset($Date);
            unset($Commune);
            echo "fin " . $baba . "</br>";
        }
    }
}
开发者ID:rebe100x,项目名称:YAKREP,代码行数:31,代码来源:ouestfrance_info.php


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