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


PHP Varien_Data_Collection_Db::addAttributeToFilter方法代码示例

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


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

示例1: addStatusFilterToOrders

 /**
  * Filter an order collection by status/state depending on MailUp config
  * NOTE that cannot override collection consistently as the class changed name in 1.6
  *
  * @param Varien_Data_Collection_Db $collection
  * @return $this
  */
 public function addStatusFilterToOrders($collection)
 {
     $config = Mage::getModel('mailup/config');
     // Add condition to skip orders that have incorrect statuses
     $allowedStatuses = $config->getQualifyingOrderStatuses();
     // If config options, use the given statuses
     if (count($allowedStatuses) > 0) {
         $collection->addAttributeToFilter('status', $allowedStatuses);
     } else {
         // Else, use complete, closed and processing state only
         $allowedStates = $config->getDefaultQualifyingStates();
         $collection->addAttributeToFilter('state', $allowedStates);
     }
     return $this;
 }
开发者ID:hanicker,项目名称:mailup-magento,代码行数:22,代码来源:Order.php

示例2: addIncrementalFilter

 /**
  * Add filter to collection to make it only include records necessary for automatic daily feed (instead of one-time baseline feed).
  *
  * @param Varien_Data_Collection_Db $collection Collection of data which will be spit out as feed
  */
 protected function addIncrementalFilter($collection, $incrementalDate = NULL)
 {
     Mage::helper('mybuys')->log('Adding incremental filters to product feed', Zend_Log::INFO, Mybuys_Connector_Helper_Data::LOG_FILE);
     // daily feeds do not include out of stock items Filter on in_stock
     $collection->addAttributeToFilter('is_in_stock', 1);
     // No incremental date filtering of this feed
     return $collection;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:13,代码来源:Product.php


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