当前位置: 首页>>代码示例>>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;未经允许,请勿转载。