Exemplo n.º 1
0
 /**
  * Identify version of requested operation.
  *
  * This method is required when there are two or more resource versions specified in request:
  * http://magento.host/api/soap?wsdl&resources[resource_a]=v1&resources[resource_b]=v2 <br/>
  * In this case it is not obvious what version of requested operation should be used.
  *
  * @param string $operationName
  * @return int
  * @throws Mage_Webapi_Exception
  */
 protected function _getOperationVersion($operationName)
 {
     $requestedResources = $this->_request->getRequestedResources();
     $resourceName = $this->_apiConfig->getResourceNameByOperation($operationName);
     if (!isset($requestedResources[$resourceName])) {
         throw new Mage_Webapi_Exception($this->_helper->__('The version of "%s" operation cannot be identified.', $operationName), Mage_Webapi_Exception::HTTP_NOT_FOUND);
     }
     $version = (int) str_replace('V', '', ucfirst($requestedResources[$resourceName]));
     $this->_apiConfig->validateVersionNumber($version, $resourceName);
     return $version;
 }