當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ViewManager::getAllProducts方法代碼示例

本文整理匯總了PHP中ViewManager::getAllProducts方法的典型用法代碼示例。如果您正苦於以下問題:PHP ViewManager::getAllProducts方法的具體用法?PHP ViewManager::getAllProducts怎麽用?PHP ViewManager::getAllProducts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ViewManager的用法示例。


在下文中一共展示了ViewManager::getAllProducts方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: firstStep

 public function firstStep()
 {
     $new_products_manager = new ViewManager();
     $tmp_manager = new UpdateTmpTables();
     $insert_product = new PrestashopProduct();
     $product_update = new ProductUpdate();
     //prendo tutti i prodotti
     $all_products = $new_products_manager->getAllProducts();
     foreach ($all_products as $product) {
         $array_reference = $product[0];
         $key = $array_reference['Reference'];
         asort($product[1]);
         asort($product[2]);
         $result = $product_update->productExists($key);
         if (gettype($result) === "integer") {
             foreach ($product[1] as $triple) {
                 $tmp_combination = $product[2];
                 $array_combination = $tmp_combination[$triple];
                 $tmp_code = $array_combination['Codici'];
                 $tmp_explode_code = explode(',', $tmp_code);
                 if ($product_update->colorSizeExists($key, $result, $tmp_explode_code[0], $tmp_explode_code[1]) == 1) {
                     $array_product = $insert_product->updateProductForPrestashop($product[0], (int) $result, $this->url_photo, $product[1], $product[2]);
                     $tmp_manager->insertTmpProducts($result, $key);
                     if (!empty($array_product[2])) {
                         foreach ($array_product[2] as $new_img) {
                             $new_photo_infos = explode(';', $new_img);
                             $tmp_manager->insertImageField($this->url_photo . $new_photo_infos[1], $array_product[0], $new_photo_infos[0]);
                         }
                     }
                 }
             }
             $url = $this->formatUrlPhoto($key);
             $this->_updatePsImages($result, $url);
         }
     }
     //prendo i prodotti nuovi
     $newProducts = $new_products_manager->getNewProduct();
     if (!empty($newProducts)) {
         foreach ($newProducts as $product) {
             $array_reference = $product[0];
             $key = $array_reference['Reference'];
             asort($product[1]);
             asort($product[2]);
             $array_product = $insert_product->insertProductForPrestashop($product[0], $this->url_photo, $product[1], $product[2]);
             $array_images_id = $array_product[1];
             for ($i = 0; $i < sizeof($array_images_id); $i++) {
                 $tmp = explode(';', $array_images_id[$i]);
                 if (empty($tmp)) {
                     break;
                 }
                 $tmp_manager->insertImageField($this->url_photo . $tmp[1], $array_product[0], $tmp[0]);
             }
             $tmp_manager->insertTmpProducts((int) $array_product[0], $key);
         }
     }
     //differenze nei prodotti
     $products_differences = $new_products_manager->getProductDifferences();
     if (!empty($products_differences)) {
         foreach ($products_differences as $product) {
             $array_reference = $product[0];
             $key = $array_reference['Reference'];
             asort($product[1]);
             asort($product[2]);
             $array_product = $insert_product->updateProductForPrestashop($product[0], (int) $product[3], $this->url_photo, $product[1], $product[2]);
             if (!empty($array_product[2])) {
                 foreach ($array_product[2] as $new_img) {
                     $new_photo_infos = explode(';', $new_img);
                     $tmp_manager->insertImageField($this->url_photo . $new_photo_infos[1], $array_product[0], $new_photo_infos[0]);
                 }
             }
             $tmp_manager->updateTmpProducts((int) $array_product[0], $key);
         }
     }
     $this->logger->postMessage("Update finished! Cleaning up...", "DEBUG");
     $buffer_manager = new ProductBufferTables();
     $buffer_manager->freeBufferTable();
 }
開發者ID:valucifer,項目名稱:S-SoldP-Pal,代碼行數:77,代碼來源:PrestashopUpdate.php


注:本文中的ViewManager::getAllProducts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。