本文整理汇总了PHP中Addresses::getMapCoords方法的典型用法代码示例。如果您正苦于以下问题:PHP Addresses::getMapCoords方法的具体用法?PHP Addresses::getMapCoords怎么用?PHP Addresses::getMapCoords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Addresses
的用法示例。
在下文中一共展示了Addresses::getMapCoords方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getXMLDataMap
/**
* Get the reviews data map coordinates
*/
public static function getXMLDataMap($locale = 1)
{
$data = array();
$j = 0;
$translator = Shineisp_Registry::getInstance()->Zend_Translate;
$records = Doctrine_Query::create()->from('Reviews r')->leftJoin('r.Products p')->leftJoin("p.ProductsData pd WITH pd.language_id = {$locale}")->where("active = ?", true)->andWhere('latitude <> ?', "")->andWhere('longitude <> ?', "")->execute(array(), Doctrine_Core::HYDRATE_ARRAY);
foreach ($records as $record) {
$text = "<div id=\"mycontent\">";
$text .= "<div id=\"bodyContent\">";
$text .= "<h4><a href=\"/" . $record['Products']['uri'] . ".html\">" . $record['Products']['ProductsData'][0]['name'] . "</a></h4>";
for ($i = 0; $i < $record['stars']; $i++) {
$text .= "*";
}
$text .= "<br/><br/>" . $record['review'] . "<br/>";
$text .= "<p><b>inviato da " . $record['nick'] . "</b> il " . Shineisp_Commons_Utilities::formatDateOut($record['publishedat']) . "</p>";
$text .= "</div></div>";
$data['marker'][$j]['@attributes'] = array('lat' => $record['latitude'], 'lng' => $record['longitude']);
$data['marker'][$j]['text']['@cdata'] = $text;
$j++;
}
$customers = Addresses::getMapCoords();
foreach ($customers as $record) {
if (!empty($record['company'])) {
$text = "";
#$text = "<div id=\"mycontent\">";
#$text .= "<div id=\"bodyContent\">";
#$text .= "<p>". $translator->_('%s has choosen our company as I.T. partners', "<b>" . $record['company']. "</b>") . "</p>";
#$text .= "</div></div>";
$data['marker'][$j]['@attributes'] = array('lat' => $record['latitude'], 'lng' => $record['longitude'], 'icontype' => "purple");
$data['marker'][$j]['text']['@cdata'] = $text;
$j++;
}
}
$xml = Shineisp_Commons_Array2XML::createXML('markers', $data);
$xml->save(PUBLIC_PATH . "/documents/reviews.xml");
return true;
}