本文整理汇总了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);
}
示例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;
}
示例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;
}