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


PHP type::getFilter方法代码示例

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


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

示例1: filterToptierAffiliateAccount

 /**
  * 
  * @param type $collection
  * @param type $column
  * @return type
  */
 public function filterToptierAffiliateAccount(&$collection, $column)
 {
     $accountTable = Mage::getModel('core/resource')->getTableName('affiliateplus_account');
     $value = $column->getFilter()->getValue();
     if (!isset($value)) {
         return;
     }
     if ($value == 'N/A') {
         $collection->getSelect()->where("{$accountTable}.name IS NULL");
         return;
     }
     $collection->getSelect()->where("{$accountTable}.name = '{$value}'");
 }
开发者ID:billadams,项目名称:forever-frame,代码行数:19,代码来源:Observer.php

示例2: _addColumnFilterToCollection

 /**
  * Adds column to filter list if needed
  * @param type $column Column to filter
  * @return TinyBrick_OrderEdit_Block_Adminhtml_Sales_Order_Edit_Search_Grid 
  */
 protected function _addColumnFilterToCollection($column)
 {
     // Set custom filter for in product flag
     if ($column->getId() == 'in_products') {
         $productIds = $this->_getSelectedProducts();
         if (empty($productIds)) {
             $productIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('entity_id', array('in' => $productIds));
         } else {
             if ($productIds) {
                 $this->getCollection()->addFieldToFilter('entity_id', array('nin' => $productIds));
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:AleksNesh,项目名称:pandora,代码行数:25,代码来源:Grid.php

示例3: filterCallback

 /**
  * Callback filter for Website/ Customer group
  * 
  * @param type $collection
  * @param type $column
  * @return type
  */
 public function filterCallback($collection, $column)
 {
     $value = $column->getFilter()->getValue();
     if (!is_null(@$value)) {
         $collection->addFieldToFilter($column->getIndex(), array('finset' => $value));
     }
 }
开发者ID:kanotest15,项目名称:cbmagento,代码行数:14,代码来源:Grid.php

示例4: filterCallback

 /**
  * Callback filter for Warehouse
  * 
  * @param type $collection
  * @param type $column
  * @return type
  */
 public function filterCallback($collection, $column)
 {
     $value = $column->getFilter()->getValue();
     if (!is_null(@$value)) {
         $collection->getSelect()->where('inventory_shipment.warehouse_id = ?', $value);
     }
     return $this;
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:15,代码来源:Grid.php

示例5: _filterNumberCallback

 /**
  * Filter number field
  * 
  * @param type $collection
  * @param type $column
  * @return collection
  */
 protected function _filterNumberCallback($collection, $column)
 {
     $filter = $column->getFilter()->getValue();
     $field = $this->_getRealFieldFromAlias($column->getIndex());
     if (isset($filter['from']) && $filter['from'] != '') {
         $collection->getSelect()->having($field . ' >= ' . $filter['from']);
     }
     if (isset($filter['to']) && $filter['to'] != '') {
         $collection->getSelect()->having($field . ' <= ' . $filter['to']);
     }
     $collection->setIsGroupCountSql(true);
     $collection->setResetHaving(true);
     return $collection;
 }
开发者ID:javik223,项目名称:Evron-Magento,代码行数:21,代码来源:Grid.php

示例6: _filterNumberCallback

 /**
  * Filter number field
  * 
  * @param type $collection
  * @param type $column
  * @return collection
  */
 protected function _filterNumberCallback($collection, $column)
 {
     $filter = $column->getFilter()->getValue();
     $field = $this->_getRealFieldFromAlias($column->getIndex());
     if (isset($filter['from'])) {
         $collection->getSelect()->having($field . ' >= \'' . $filter['from'] . '\'');
     }
     if (isset($filter['to'])) {
         $collection->getSelect()->having($field . ' <= \'' . $filter['to'] . '\'');
     }
     return $collection;
 }
开发者ID:javik223,项目名称:Evron-Magento,代码行数:19,代码来源:Grid.php

示例7: _filterDateCallback

 /**
  * Filter datetime field
  * 
  * @param type $collection
  * @param type $column
  * @return type
  */
 protected function _filterDateCallback($collection, $column)
 {
     $filter = $column->getFilter()->getValue();
     $field = $this->_getRealFieldFromAlias($column->getIndex());
     if (isset($filter['orig_from'])) {
         $from = date('Y-m-d H:i:s', strtotime($filter['orig_from']));
         $collection->getSelect()->having($field . ' >= \'' . $from . '\'');
     }
     if (isset($filter['orig_to'])) {
         $to = date('Y-m-d H:i:s', strtotime($filter['orig_to']));
         $collection->getSelect()->having($field . ' <= \'' . $to . '\'');
     }
     return $collection;
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:21,代码来源:Abstractgrid.php


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