本文整理汇总了PHP中Mage_Core_Controller_Request_Http::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Controller_Request_Http::get方法的具体用法?PHP Mage_Core_Controller_Request_Http::get怎么用?PHP Mage_Core_Controller_Request_Http::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Controller_Request_Http
的用法示例。
在下文中一共展示了Mage_Core_Controller_Request_Http::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Perform an export according to the given request.
*
* @param Mage_Core_Controller_Request_Http $request
* @param Mage_Core_Controller_Response_Http $response
* @throws Exception
*/
public function process(Mage_Core_Controller_Request_Http $request, Mage_Core_Controller_Response_Http $response)
{
// In case store is part of URL path use it to choose config.
$store = $request->get('store');
if ($store) {
$store = Mage::app()->getStore($store);
}
$apiConfigCharset = Mage::getStoreConfig("api/config/charset", $store);
$start_date = strtotime($request->getParam('start_date'));
$end_date = strtotime($request->getParam('end_date'));
if (!$start_date || !$end_date) {
throw new Exception('Start and end dates are required', 400);
}
$page = (int) $request->getParam('page');
/* @var $orders Mage_Sales_Model_Mysql4_Order_Collection */
$orders = Mage::getResourceModel('sales/order_collection');
// might use 'created_at' attribute instead
$orders->addAttributeToFilter('updated_at', array('from' => date('Y-m-d H:i:s', $start_date), 'to' => date('Y-m-d H:i:s', $end_date)));
if ($store) {
$orders->addAttributeToFilter('store_id', $store->getId());
}
if ($page > 0) {
$orders->setPage($page, $this->_getExportPageSize());
}
$xml = new XMLWriter();
$xml->openMemory();
$xml->startDocument('1.0', $apiConfigCharset);
$this->_writeOrders($orders, $xml, $store ? $store->getId() : 0);
$xml->endDocument();
$response->clearHeaders()->setHeader('Content-Type', 'text/xml; charset=' . $apiConfigCharset)->setBody($xml->outputMemory(true));
}