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


PHP ProductCategory::getAll方法代碼示例

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


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

示例1: _getEndJs

 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $manufactureArray = $supplierArray = $statuses = $productCategoryArray = array();
     foreach (Manufacturer::getAll() as $os) {
         $manufactureArray[] = $os->getJson();
     }
     foreach (Supplier::getAll() as $os) {
         $supplierArray[] = $os->getJson();
     }
     foreach (ProductStatus::getAll() as $os) {
         $statuses[] = $os->getJson();
     }
     foreach (ProductCategory::getAll() as $os) {
         $productCategoryArray[] = $os->getJson();
     }
     $js = parent::_getEndJs();
     if (($product = Product::get($this->Request['id'])) instanceof Product) {
         $js .= "\$('searchPanel').hide();";
         $js .= "pageJs._singleProduct = true;";
     }
     $js .= 'pageJs._loadManufactures(' . json_encode($manufactureArray) . ')';
     $js .= '._loadSuppliers(' . json_encode($supplierArray) . ')';
     $js .= '._loadCategories(' . json_encode($productCategoryArray) . ')';
     $js .= '._loadProductStatuses(' . json_encode($statuses) . ')';
     $js .= "._loadChosen()";
     $js .= "._bindSearchKey()";
     $js .= ".setCallbackId('priceMatching', '" . $this->priceMatchingBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleActive', '" . $this->toggleActiveBtn->getUniqueID() . "')";
     $js .= ".getResults(true, " . $this->pageSize . ");";
     return $js;
 }
開發者ID:larryu,項目名稱:magento-b2b,代碼行數:35,代碼來源:ProductController.php

示例2: populateModelData

 /**
  * Populate Product Template Model with data
  * @param Product Template object $model
  * @param int $counter
  */
 public function populateModelData(&$model, $counter)
 {
     assert('$model instanceof ProductTemplate');
     parent::populateModel($model);
     $productTemplateRandomData = self::getProductTemplatesRandomData();
     $name = $productTemplateRandomData['names'][$counter];
     $productCategoryName = self::getProductCategoryForTemplate($name);
     $allCats = ProductCategory::getAll();
     foreach ($allCats as $category) {
         if ($category->name == $productCategoryName) {
             $categoryId = $category->id;
         }
     }
     $productCategory = ProductCategory::getById($categoryId);
     $model->name = $name;
     $model->productCategories->add($productCategory);
     $model->priceFrequency = 2;
     $model->cost->value = 200;
     $model->listPrice->value = 200;
     $model->sellPrice->value = 200;
     $model->status = ProductTemplate::STATUS_ACTIVE;
     $model->type = ProductTemplate::TYPE_PRODUCT;
     $sellPriceFormula = new SellPriceFormula();
     $sellPriceFormula->type = SellPriceFormula::TYPE_EDITABLE;
     $model->sellPriceFormula = $sellPriceFormula;
 }
開發者ID:sandeep1027,項目名稱:zurmo_,代碼行數:31,代碼來源:ProductTemplatesDemoDataMaker.php

示例3: _getEndJs

 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $manufactureArray = $supplierArray = $statuses = $productCategoryArray = array();
     foreach (Manufacturer::getAll() as $os) {
         $manufactureArray[] = $os->getJson();
     }
     foreach (Supplier::getAll() as $os) {
         $supplierArray[] = $os->getJson();
     }
     foreach (ProductStatus::getAll() as $os) {
         $statuses[] = $os->getJson();
     }
     foreach (ProductCategory::getAll() as $os) {
         $productCategoryArray[] = $os->getJson();
     }
     $js = parent::_getEndJs();
     if (($product = Product::get($this->Request['id'])) instanceof Product) {
         $js .= "\$('searchPanel').hide();";
         $js .= "pageJs._singleProduct = true;";
     }
     $js .= 'pageJs.totalValueId = "total-found-value";';
     $js .= 'pageJs.totalQtyId = "total-found-qty";';
     $js .= 'pageJs._loadManufactures(' . json_encode($manufactureArray) . ')';
     $js .= '._loadSuppliers(' . json_encode($supplierArray) . ')';
     $js .= '._loadCategories(' . json_encode($productCategoryArray) . ')';
     $js .= '._loadProductStatuses(' . json_encode($statuses) . ')';
     $js .= "._loadChosen()";
     $js .= "._bindSearchKey()";
     $js .= "._bindNewRuleBtn()";
     $js .= ".setCallbackId('priceMatching', '" . $this->priceMatchingBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleActive', '" . $this->toggleActiveBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleSellOnWeb', '" . $this->toggleSellOnWebBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('updatePrice', '" . $this->updatePriceBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('updateStockLevel', '" . $this->updateStockLevelBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleIsKit', '" . $this->toggleIsKitBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleManualFeed', '" . $this->toggleManualFeedBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('newRule', '" . $this->newRuleBtn->getUniqueID() . "')";
     $js .= ".getResults(true, " . $this->pageSize . ");";
     return $js;
 }
開發者ID:larryu,項目名稱:magento-b2b,代碼行數:44,代碼來源:ProductController.php

示例4: testGetAllWhenThereAreNone

 public function testGetAllWhenThereAreNone()
 {
     Yii::app()->user->userModel = User::getByUsername('super');
     $productCategories = ProductCategory::getAll();
     $this->assertEquals(0, count($productCategories));
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:6,代碼來源:ProductCategoryTest.php

示例5: testSuperUserDeleteAction

 public function testSuperUserDeleteAction()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     Yii::app()->user->userModel = $super;
     $productCategory = ProductCategoryTestHelper::createProductCategoryByName("My New Category");
     //Delete a product template
     $this->setGetArray(array('id' => $productCategory->id));
     $this->resetPostArray();
     $productCategories = ProductCategory::getAll();
     $this->assertEquals(14, count($productCategories));
     $this->runControllerWithRedirectExceptionAndGetContent('productTemplates/category/delete');
     $productCategories = ProductCategory::getAll();
     $this->assertEquals(13, count($productCategories));
     try {
         ProductCategory::getById($productCategory->id);
         $this->fail();
     } catch (NotFoundException $e) {
         //success
     }
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:20,代碼來源:ProductCategorySuperUserWalkthroughTest.php

示例6: renderModalList

 protected function renderModalList($modalViewName, $pageTitle)
 {
     $rolesModalTreeView = new $modalViewName($this->getId(), $this->getModule()->getId(), $_GET['modalTransferInformation']['sourceModelId'], ProductCategory::getAll('name'), $_GET['modalTransferInformation']['sourceIdFieldId'], $_GET['modalTransferInformation']['sourceNameFieldId'], $_GET['modalTransferInformation']['modalId']);
     Yii::app()->getClientScript()->setToAjaxMode();
     $view = new ModalView($this, $rolesModalTreeView);
     return $view->render();
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:7,代碼來源:CategoryController.php

示例7: syncAllProductCategory

 public function syncAllProductCategory()
 {
     $pcArray = ProductCategory::getAll(true, null, DaoQuery::DEFAUTL_PAGE_SIZE, array('position' => 'ASC'));
     if (is_array($pcArray) && count($pcArray) > 0) {
         $soapClient = $this->_mySoapClient;
         foreach ($pcArray as $productCategory) {
             $categoryData = $this->_generateCategoryData($productCategory);
             if (($pcMageId = trim($productCategory->mageId)) === '' || $pcMageId === '0') {
                 $parentId = 1;
                 if (($pcParent = $productCategory->getParent()) instanceof ProductCategory) {
                     $parentId = (int) $pcParent->getMageId();
                 }
                 $newMageId = $soapClient->catalogCategoryCreate($this->_session, $parentId, $categoryData);
                 $productCategory->setMageId($newMageId)->save();
             } else {
                 $updated = $soapClient->catalogCategoryUpdate($this->_session, $pcMageId, $categoryData);
             }
         }
     }
     return $this;
 }
開發者ID:larryu,項目名稱:magento-b2b,代碼行數:21,代碼來源:ProductUpdateConnector.php


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