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


PHP Varien_Data_Collection::addFieldToFilter方法代码示例

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


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

示例1: _filterInSetsCondition

 /**
  * @param Varien_Data_Collection $collection
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  */
 protected function _filterInSetsCondition($collection, $column)
 {
     $selected = $this->_getSelectedAttributeSets();
     if (empty($selected)) {
         $selected = '0';
     }
     $value = $column->getFilter()->getValue();
     if ($value) {
         $collection->addFieldToFilter('main_table.attribute_set_id', array('in' => $selected));
     } else {
         $collection->addFieldToFilter('main_table.attribute_set_id', array('nin' => $selected));
     }
 }
开发者ID:hanhpv,项目名称:bulk-assigning-attributes,代码行数:17,代码来源:AttributeSets.php

示例2: _prepareCollection

 protected function _prepareCollection()
 {
     $quote = $this->getOrder()->getQuote();
     if ($quote) {
         $collection = $quote->getItemsCollection(false);
     } else {
         $collection = new Varien_Data_Collection();
     }
     $collection->addFieldToFilter('parent_item_id', array('null' => true));
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
开发者ID:q2taras,项目名称:magento-oneclickorder,代码行数:12,代码来源:Cart.php

示例3: _prepareCollection

 protected function _prepareCollection()
 {
     $customer = Mage::registry('current_customer');
     $storeIds = Mage::app()->getWebsite($this->getWebsiteId())->getStoreIds();
     $quote = Mage::getModel('sales/quote')->setSharedStoreIds($storeIds)->loadByCustomer($customer);
     if ($quote) {
         $collection = $quote->getItemsCollection(false);
     } else {
         $collection = new Varien_Data_Collection();
     }
     $collection->addFieldToFilter('parent_item_id', array('null' => true));
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:14,代码来源:Cart.php

示例4: _prepareCollection

 protected function _prepareCollection()
 {
     $quote = Mage::getModel('Mage_Sales_Model_Quote');
     // set website to quote, if any
     if ($this->getWebsiteId()) {
         $quote->setWebsite(Mage::app()->getWebsite($this->getWebsiteId()));
     }
     $quote->loadByCustomer(Mage::registry('current_customer'));
     if ($quote) {
         $collection = $quote->getItemsCollection(false);
     } else {
         $collection = new Varien_Data_Collection();
     }
     $collection->addFieldToFilter('parent_item_id', array('null' => true));
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
开发者ID:relue,项目名称:magento2,代码行数:17,代码来源:Cart.php


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