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


PHP Extended::_addColumnFilterToCollection方法代码示例

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


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

示例1: _addColumnFilterToCollection

 /**
  * @param Column $column
  * @return $this
  */
 protected function _addColumnFilterToCollection($column)
 {
     // Set custom filter for in category flag
     if ($column->getId() == 'in_category') {
         $productIds = $this->_getSelectedProducts();
         if (empty($productIds)) {
             $productIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);
         } elseif (!empty($productIds)) {
             $this->getCollection()->addFieldToFilter('entity_id', ['nin' => $productIds]);
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:22,代码来源:Product.php

示例2: _addColumnFilterToCollection

 /**
  * @param Column $column
  * @return $this
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'in_role_users') {
         $inRoleIds = $this->getUsers();
         if (empty($inRoleIds)) {
             $inRoleIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('user_id', ['in' => $inRoleIds]);
         } else {
             if ($inRoleIds) {
                 $this->getCollection()->addFieldToFilter('user_id', ['nin' => $inRoleIds]);
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:hientruong90,项目名称:magento2_installer,代码行数:23,代码来源:User.php

示例3: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'in_lists_gridtabs') {
         $inlistsIds = $this->getAlists();
         if (empty($inlistsIds)) {
             $inlistsIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('id', ['in' => $inlistsIds]);
         } else {
             if ($inlistsIds) {
                 $this->getCollection()->addFieldToFilter('id', ['nin' => $inlistsIds]);
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:pradeeprcs,项目名称:TestModule,代码行数:19,代码来源:Gridtabs.php

示例4: _addColumnFilterToCollection

 /**
  * @param Column $column
  * @return $this
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'assigned_user_role') {
         $userRoles = $this->getSelectedRoles();
         if (empty($userRoles)) {
             $userRoles = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('role_id', ['in' => $userRoles]);
         } else {
             if ($userRoles) {
                 $this->getCollection()->addFieldToFilter('role_id', ['nin' => $userRoles]);
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:nja78,项目名称:magento2,代码行数:23,代码来源:Roles.php

示例5: _addColumnFilterToCollection

 /**
  * add Column Filter To Collection
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'in_banner') {
         $bannerIds = $this->getSelectedSliderBanners();
         if (empty($bannerIds)) {
             $bannerIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('banner_id', array('in' => $bannerIds));
         } else {
             if ($bannerIds) {
                 $this->getCollection()->addFieldToFilter('banner_id', array('nin' => $bannerIds));
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:igor-lero9,项目名称:magebase_carousel,代码行数:22,代码来源:Banners.php

示例6: _addColumnFilterToCollection

 /**
  * @param \Magento\Backend\Block\Widget\Grid\Column $column
  * @return $this
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($this->getCollection()) {
         if ($column->getId() == 'websites') {
             $this->getCollection()->joinField('websites', 'catalog_product_website', 'website_id', 'product_id=entity_id', null, 'left');
         }
     }
     return parent::_addColumnFilterToCollection($column);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:13,代码来源:Grid.php

示例7: _addColumnFilterToCollection

 /**
  * Add filter
  *
  * @param object $column
  * @return $this
  */
 protected function _addColumnFilterToCollection($column)
 {
     // Set custom filter for in product flag
     if ($column->getId() == 'in_questions') {
         $questionIds = $this->_getSelectedQuestions();
         if (empty($questionIds)) {
             $questionIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('question_id', ['in' => $questionIds]);
         } else {
             if ($questionIds) {
                 $this->getCollection()->addFieldToFilter('question_id', ['nin' => $questionIds]);
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:vladankuzmanovic,项目名称:ProductFaq,代码行数:26,代码来源:Question.php

示例8: _addColumnFilterToCollection

 /**
  * @param Column $column
  * @return $this
  */
 protected function _addColumnFilterToCollection($column)
 {
     // Set custom filter for in product flag
     if ($column->getId() == 'in_products') {
         $selected = $this->_getSelectedProducts();
         if (empty($selected)) {
             $selected = '';
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('sku', array('in' => $selected));
         } else {
             $this->getCollection()->addFieldToFilter('sku', array('nin' => $selected));
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:22,代码来源:Sku.php

示例9: _addColumnFilterToCollection

 /**
  * Filter checked/unchecked rows in grid
  *
  * @param Column $column
  * @return $this
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'in_products') {
         $selected = $this->getSelectedProducts();
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('entity_id', ['in' => $selected]);
         } else {
             $this->getCollection()->addFieldToFilter('entity_id', ['nin' => $selected]);
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:20,代码来源:Chooser.php

示例10: _addColumnFilterToCollection

 /**
  * @param \Magento\Backend\Block\Widget\Grid\Column $column
  * @return $this
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'in_articles') {
         $articleIds = $this->_getSelectedArticles();
         if (empty($articleIds)) {
             $articleIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('article_id', ['in' => $articleIds]);
         } else {
             if ($articleIds) {
                 $this->getCollection()->addFieldToFilter('article_id', ['nin' => $articleIds]);
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:pleminh,项目名称:Gemtoo,代码行数:23,代码来源:Article.php

示例11: _addColumnFilterToCollection

 /**
  * @param \Magento\Backend\Block\Widget\Grid\Column $column
  * @return $this
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'in_posts') {
         $postIds = $this->_getSelectedPosts();
         if (empty($postIds)) {
             $postIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('main_table.post_id', ['in' => $postIds]);
         } else {
             if ($postIds) {
                 $this->getCollection()->addFieldToFilter('main_table.post_id', ['nin' => $postIds]);
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:mageplaza,项目名称:magento-2-blog-extension,代码行数:23,代码来源:Post.php

示例12: _addColumnFilterToCollection

 /**
  * Add store filter
  *
  * @param \Magento\Backend\Block\Widget\Grid\Column $column
  * @return $this
  */
 protected function _addColumnFilterToCollection($column)
 {
     parent::_addColumnFilterToCollection($column);
     return $this;
 }
开发者ID:kietluu,项目名称:magento2-backend-training,代码行数:11,代码来源:Grid.php


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