Example #1
0
 public function getCategories(Shopware_StoreApi_Models_Query_Category $categoryQuery)
 {
     if (!$categoryQuery instanceof Shopware_StoreApi_Models_Query_Category) {
         return new Shopware_StoreApi_Exception_Response('The parameter productModel is not instance of Shopware_StoreApi_Models_Query_Category', 10);
     }
     $start = $categoryQuery->getStart();
     $limit = $categoryQuery->getLimit();
     $orderBy = $categoryQuery->getOrderBy();
     $orderDirection = $categoryQuery->getOrderDirection();
     $criterion = $categoryQuery->getCriterion();
     return $this->gateway->getCategories($start, $limit, $orderBy, $orderDirection, $criterion);
 }
Example #2
0
 public function getProductsGroupByCategories(Shopware_StoreApi_Models_Query_Product $productQuery, Shopware_StoreApi_Models_Query_Category $categoryQuery)
 {
     if (!$productQuery instanceof Shopware_StoreApi_Models_Query_Product) {
         return new Shopware_StoreApi_Exception_Response('The parameter productModel is not instance of Shopware_StoreApi_Models_Query_Product', 10);
     }
     if (!$categoryQuery instanceof Shopware_StoreApi_Models_Query_Category) {
         return new Shopware_StoreApi_Exception_Response('The parameter productModel is not instance of Shopware_StoreApi_Models_Query_Category', 10);
     }
     $productQueryData = array();
     $productQueryData['start'] = $productQuery->getStart();
     $productQueryData['limit'] = $productQuery->getLimit();
     $productQueryData['orderBy'] = $productQuery->getOrderBy();
     $productQueryData['orderDirection'] = $productQuery->getOrderDirection();
     $productQueryData['criterion'] = $productQuery->getCriterion();
     $categoryQueryData = array();
     $categoryQueryData['start'] = $categoryQuery->getStart();
     $categoryQueryData['limit'] = $categoryQuery->getLimit();
     $categoryQueryData['orderBy'] = $categoryQuery->getOrderBy();
     $categoryQueryData['orderDirection'] = $categoryQuery->getOrderDirection();
     $categoryQueryData['criterion'] = $categoryQuery->getCriterion();
     return $this->gateway->getProductsGroupByCategories($productQueryData, $categoryQueryData);
 }