当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::getAllIds方法代码示例

本文整理汇总了PHP中Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::getAllIds方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::getAllIds方法的具体用法?PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::getAllIds怎么用?PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::getAllIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection的用法示例。


在下文中一共展示了Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::getAllIds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAllIds

 public function getAllIds($limit = null, $offset = null)
 {
     if (!$this->listingProductMode) {
         return parent::getAllIds($limit, $offset);
     }
     // hack for selecting listing product ids instead entity ids
     $idsSelect = clone $this->getSelect();
     $idsSelect->reset(Zend_Db_Select::ORDER);
     $idsSelect->reset(Zend_Db_Select::LIMIT_COUNT);
     $idsSelect->reset(Zend_Db_Select::LIMIT_OFFSET);
     $idsSelect->reset(Zend_Db_Select::COLUMNS);
     $idsSelect->columns('lp.' . $this->getIdFieldName());
     $idsSelect->limit($limit, $offset);
     $idsSelect->resetJoinLeft();
     return $this->getConnection()->fetchCol($idsSelect, $this->_bindParams);
 }
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:16,代码来源:Collection.php

示例2: getAllIds

 public function getAllIds($limit = null, $offset = null)
 {
     if (!$this->listingProductMode) {
         return parent::getAllIds($limit, $offset);
     }
     // hack for selecting listing product ids instead entity ids
     $idsSelect = clone $this->getSelect();
     $idsSelect->reset(Zend_Db_Select::ORDER);
     $idsSelect->reset(Zend_Db_Select::LIMIT_COUNT);
     $idsSelect->reset(Zend_Db_Select::LIMIT_OFFSET);
     $idsSelect->columns('lp.' . $this->getIdFieldName());
     $idsSelect->limit($limit, $offset);
     $data = $this->getConnection()->fetchAll($idsSelect, $this->_bindParams);
     $ids = array();
     foreach ($data as $row) {
         $ids[] = $row[$this->getIdFieldName()];
     }
     return $ids;
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:19,代码来源:Collection.php

示例3: _walkCollectionRelation

 /**
  * Walk Product Collection for Relation Parent products
  *
  * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
  * @param Mage_Core_Model_Store|Mage_Core_Model_Website $store
  * @param array $attributes
  * @param array $prices
  * @return Mage_CatalogIndex_Model_Indexer
  */
 public function _walkCollectionRelation($collection, $store, $attributes = array(), $prices = array())
 {
     if ($store instanceof Mage_Core_Model_Website) {
         $storeObject = $store->getDefaultStore();
     } elseif ($store instanceof Mage_Core_Model_Store) {
         $storeObject = $store;
     }
     $statusCond = array('in' => Mage::getSingleton('catalog/product_status')->getSaleableStatusIds());
     $productCount = $collection->getSize();
     $iterateCount = $productCount / self::STEP_SIZE;
     for ($i = 0; $i < $iterateCount; $i++) {
         $stepData = $collection->getAllIds(self::STEP_SIZE, $i * self::STEP_SIZE);
         foreach ($this->_getPriorifiedProductTypes() as $type) {
             $retriever = $this->getRetreiver($type);
             if (!$retriever->getTypeInstance()->isComposite()) {
                 continue;
             }
             $parentIds = $retriever->getTypeInstance()->getParentIdsByChild($stepData);
             if ($parentIds) {
                 $parentCollection = $this->_getProductCollection($storeObject, $parentIds);
                 $parentCollection->addAttributeToFilter('status', $statusCond);
                 $parentCollection->addFieldToFilter('type_id', $type);
                 $this->_walkCollection($parentCollection, $storeObject, $attributes, $prices);
                 $this->_afterPlainReindex($store, $parentIds);
             }
         }
     }
     return $this;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:38,代码来源:Indexer.php


注:本文中的Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::getAllIds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。