Esempio n. 1
0
 /**
  * Check whether current request matches any route of specified method or not. Method version is taken into account.
  *
  * @param Mage_Webapi_Controller_Request_Rest $request
  * @param string $methodName
  * @param string $version
  * @throws Mage_Webapi_Exception In case when request does not match any route of specified method.
  */
 public function checkRoute(Mage_Webapi_Controller_Request_Rest $request, $methodName, $version)
 {
     $resourceName = $request->getResourceName();
     $routes = $this->_apiConfig->getMethodRestRoutes($resourceName, $methodName, $version);
     foreach ($routes as $route) {
         if ($route->match($request)) {
             return;
         }
     }
     throw new Mage_Webapi_Exception($this->_helper->__('Request does not match any route.'), Mage_Webapi_Exception::HTTP_NOT_FOUND);
 }