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


PHP Mage_Core_Model_App::getRequest方法代码示例

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


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

示例1: allowAddressValidation

 /**
  * Set the passed in address object to ignore validation only when
  * we are currently saving an order and ROM Address validation is not
  * needed.
  *
  * @param  Mage_Customer_Model_Address_Abstract
  * @return self
  */
 public function allowAddressValidation(Mage_Customer_Model_Address_Abstract $address)
 {
     /** @var Mage_Core_Controller_Request_Http */
     $request = $this->app->getRequest();
     /** @var bool */
     $needValidation = $this->validator->shouldValidateAddress($address);
     // We only want to ignore address validation when we are actually creating an order.
     // The assumption is if we get to this point, then, validating the address is
     // unnecessary if it is already valid in ROM.
     if (!$needValidation && $request->getActionName() === 'saveOrder') {
         $address->setShouldIgnoreValidation(true);
     }
     return $this;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:22,代码来源:Validation.php

示例2: determineApiType

 /**
  * Determine current API type using application request (not web API request).
  *
  * @return string
  * @throws Mage_Core_Exception
  * @throws Mage_Webapi_Exception If requested API type is invalid.
  */
 public function determineApiType()
 {
     if (is_null($this->_apiType)) {
         $request = $this->_application->getRequest();
         $apiRoute = $this->_routeFactory->createRoute('Mage_Webapi_Controller_Router_Route_Webapi', Mage_Webapi_Controller_Router_Route_Webapi::getApiRoute());
         if (!($apiTypeMatch = $apiRoute->match($request, true))) {
             throw new Mage_Webapi_Exception($this->_helper->__('Request does not match any API type route.'), Mage_Webapi_Exception::HTTP_BAD_REQUEST);
         }
         $apiType = $apiTypeMatch[Mage_Webapi_Controller_Router_Route_Webapi::PARAM_API_TYPE];
         if (!in_array($apiType, $this->getListOfAvailableApiTypes())) {
             throw new Mage_Webapi_Exception($this->_helper->__('The "%s" API type is not defined.', $apiType), Mage_Webapi_Exception::HTTP_BAD_REQUEST);
         }
         $this->_apiType = $apiType;
     }
     return $this->_apiType;
 }
开发者ID:,项目名称:,代码行数:23,代码来源:

示例3: testSetGetRequest

 public function testSetGetRequest()
 {
     $this->assertInstanceOf('Mage_Core_Controller_Request_Http', $this->_model->getRequest());
     $this->_model->setRequest(new Magento_Test_Request());
     $this->assertInstanceOf('Magento_Test_Request', $this->_model->getRequest());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:6,代码来源:AppTest.php


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