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


PHP Mage_Adminhtml_Block_Widget_Grid_Column::getIndex方法代码示例

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


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

示例1: _filterPrice

 /**
  * Callback method for applying price filter.
  * @param Mage_Catalog_Model_Resource_Product_Collection $_collection
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $_column
  */
 public function _filterPrice($_collection, $_column)
 {
     $_field = $_column->getFilterIndex() ? $_column->getFilterIndex() : $_column->getIndex();
     $_condition = $_column->getFilter()->getCondition();
     if (!$_field || !is_array($_condition)) {
         return;
     }
     if (!array_key_exists('type', $_condition) || !is_numeric($_condition['type'])) {
         $_collection->addFieldToFilter($_field, $_condition);
     } else {
         $_storeId = (int) $this->getRequest()->getParam('store', 0);
         $_store = Mage::app()->getStore($_storeId);
         $_joinCondition = array('`e`.`entity_id` = `at_reservation_price`.`entity_id`', '`at_reservation_price`.`store_id` = ' . $_store->getId(), '`at_reservation_price`.`ptype` = ' . $_condition['type']);
         if (array_key_exists('from', $_condition)) {
             $_joinCondition[] = '`at_reservation_price`.`price` >= ' . $_condition['from'];
         }
         if (array_key_exists('to', $_condition)) {
             $_joinCondition[] = '`at_reservation_price`.`price` <= ' . $_condition['to'];
         }
         $_joinCondition[] = '`at_reservation_price`.`date_from` = \'0000-00-00 00:00:00\' OR DATE(`at_reservation_price`.`date_from`) <= DATE(\'' . date('Y-m-d H:i:s', Mage::getModel('core/date')->gmtTimestamp(time())) . '\')';
         $_joinCondition[] = '`at_reservation_price`.`date_to` = \'0000-00-00 00:00:00\' OR DATE(`at_reservation_price`.`date_to`) >= DATE(\'' . date('Y-m-d H:i:s', Mage::getModel('core/date')->gmtTimestamp(time())) . '\')';
         $_collection->getSelect()->joinInner(array('at_reservation_price' => $_collection->getTable('payperrentals/reservationprices')), '(' . implode(') AND (', $_joinCondition) . ')', array('price_type' => 'at_reservation_price.ptype', 'reservation_price' => 'at_reservation_price.price', 'reservation_number' => 'at_reservation_price.numberof'));
         /** TODO Check collection count calculation with group. I think need change join for use distinct */
         $_collection->getSelect()->group('e.entity_id');
     }
 }
开发者ID:hueyl77,项目名称:fourwindsgear,代码行数:31,代码来源:Price.php

示例2: _addColumnFilterToCollection

 /**
  * Add column filter to collection
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Enterprise_Reward_Block_Adminhtml_Customer_Edit_Tab_Reward_History_Grid
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($this->getCollection()) {
         $field = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
         if ($field == 'website_id' || $field == 'points_balance') {
             $cond = $column->getFilter()->getCondition();
             if ($field && isset($cond)) {
                 $this->getCollection()->addFieldToFilter('main_table.' . $field, $cond);
             }
         } else {
             parent::_addColumnFilterToCollection($column);
         }
     }
     return $this;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:21,代码来源:Grid.php

示例3: apply

 /**
  * Apply the condition to the given collection by way of the resource specified on instantiation
  *
  * @param \Cm_Mongo_Model_Resource_Collection_Abstract $collection
  * @param \Mage_Adminhtml_Block_Widget_Grid_Column $column
  */
 public function apply(Cm_Mongo_Model_Resource_Collection_Abstract $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column)
 {
     if (is_string($this->_resource)) {
         $filterCollection = Mage::getResourceModel($this->_resource);
     } else {
         $filterCollection = $this->_resource;
     }
     var_dump($filterCollection);
     if ($this->_filters) {
         $filterCollection->addFieldToFilter($this->_filters);
     }
     $field = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
     $cond = $column->getFilter()->getCondition();
     if ($field && isset($cond)) {
         $filterCollection->addFieldToFilter($field, $cond);
     }
     $collection->addFieldToFilter($this->_field, '$in', $filterCollection->getAllIds(TRUE));
 }
开发者ID:walexer,项目名称:magento-mongo,代码行数:24,代码来源:Filter.php

示例4: _addColumnFilterToCollection

 /**
  * Add store filter
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column  $column
  * @return Enterprise_Banner_Block_Adminhtml_Banner_Grid
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getIndex() == 'stores') {
         $this->getCollection()->addStoreFilter($column->getFilter()->getCondition(), false);
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:15,代码来源:Grid.php

示例5: _addColumnFilterToCollection

 /**
  * Add column filter to collection
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist
  */
 protected function _addColumnFilterToCollection($column)
 {
     /* @var $collection Mage_Wishlist_Model_Mysql4_Item_Collection */
     $collection = $this->getCollection();
     $value = $column->getFilter()->getValue();
     if ($collection && $value) {
         switch ($column->getId()) {
             case 'product_name':
                 $collection->addProductNameFilter($value);
                 break;
             case 'store':
                 $collection->addStoreFilter($value);
                 break;
             case 'days':
                 $collection->addDaysFilter($value);
                 break;
             default:
                 $collection->addFieldToFilter($column->getIndex(), $column->getFilter()->getCondition());
                 break;
         }
     }
     return $this;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:29,代码来源:Wishlist.php

示例6: _addColumnFilterToCollection

 /**
  * Add column filter to collection
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'store') {
         $this->getCollection()->addFieldToFilter('item_store_id', $column->getFilter()->getCondition());
         return $this;
     }
     if ($this->getCollection() && $column->getFilter()->getValue()) {
         $this->getCollection()->addFieldToFilter($column->getIndex(), $column->getFilter()->getCondition());
     }
     return $this;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:17,代码来源:Wishlist.php

示例7: _setCollectionOrder

 /**
  * Sets sorting order by some column
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Mage_Adminhtml_Block_Widget_Grid
  */
 protected function _setCollectionOrder($column)
 {
     $collection = $this->getCollection();
     if ($collection) {
         $columnIndex = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
         $columnIndex = $columnIndex == 'category_ids' ? 'cat_ids' : $columnIndex;
         $collection->setOrder($columnIndex, strtoupper($column->getDir()));
     }
     return $this;
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:16,代码来源:Ezmage_Iksanika_Productupdater_Block_Catalog_Product_Grid.php

示例8: _setCollectionOrder

 /**
  * Sets sorting order by some column
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  *
  * @return $this
  */
 protected function _setCollectionOrder($column)
 {
     $collection = $this->getCollection();
     if (!$collection) {
         return $this;
     }
     $columnIndex = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
     $collection->setOrder($columnIndex, strtoupper($column->getDir()));
     return $this;
 }
开发者ID:myparcelnl,项目名称:magento1,代码行数:17,代码来源:ShipmentGrid.php

示例9: _addColumnFromBlock

 /**
  * Add a grid column from block origin
  * 
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column Column object
  * @param int $order Column order
  * @return this
  */
 protected function _addColumnFromBlock(Mage_Adminhtml_Block_Widget_Grid_Column $column, $order)
 {
     $this->addColumn($column->getId(), array('id' => $column->getId(), 'index' => $column->getIndex(), 'width' => $column->getWidth(), 'align' => array_key_exists($column->getAlign(), $this->getColumnAlignments()) ? $column->getAlign() : self::GRID_COLUMN_ALIGNMENT_LEFT, 'header' => $column->getHeader(), 'order' => $order, 'origin' => self::GRID_COLUMN_ORIGIN_GRID, 'is_visible' => 1, 'filter_only' => 0, 'is_system' => $column->getIsSystem() ? 1 : 0, 'missing' => 0, 'store_id' => null, 'renderer_type' => null, 'renderer_params' => null, 'allow_edit' => 1, 'custom_params' => null));
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:12,代码来源:Grid.php


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