本文整理汇总了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;
}
示例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];
}
示例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>";
}
}
}