當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。