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


PHP DataTable::disableFilter方法代码示例

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


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

示例1: makeSitesFlatAndApplyGenericFilters

 /**
  * Makes sure to not have any subtables anymore.
  *
  * So if $table is
  * array(
  *    site1
  *    site2
  *        subtable => site3
  *                    site4
  *                    site5
  *    site6
  *    site7
  * )
  *
  * it will return
  *
  * array(
  *    site1
  *    site2
  *    site3
  *    site4
  *    site5
  *    site6
  *    site7
  * )
  *
  * in a sorted order
  *
  * @param DataTable $table
  * @param array $request
  */
 private function makeSitesFlatAndApplyGenericFilters(DataTable $table, $request)
 {
     // we handle limit here as we have to apply sort filter, then make sites flat, then apply limit filter.
     $filterOffset = $request['filter_offset'];
     $filterLimit = $request['filter_limit'];
     unset($request['filter_offset']);
     unset($request['filter_limit']);
     // filter_sort_column does not work correctly is a bug in MultiSites.getAll
     if (!empty($request['filter_sort_column']) && $request['filter_sort_column'] === 'nb_pageviews') {
         $request['filter_sort_column'] = 'Actions_nb_pageviews';
     } elseif (!empty($request['filter_sort_column']) && $request['filter_sort_column'] === 'revenue') {
         $request['filter_sort_column'] = 'Goal_revenue';
     }
     // make sure no limit filter is applied, we will do this manually
     $table->disableFilter('Limit');
     // this will apply the sort filter
     /** @var DataTable $table */
     $genericFilter = new DataTablePostProcessor('MultiSites', 'getAll', $request);
     $table = $genericFilter->applyGenericFilters($table);
     // make sure from now on the sites will be no longer sorted, they were already sorted
     $table->disableFilter('Sort');
     // make sites flat and limit
     $table->filter('Piwik\\Plugins\\MultiSites\\DataTable\\Filter\\NestedSitesLimiter', array($filterOffset, $filterLimit));
 }
开发者ID:piwik,项目名称:piwik,代码行数:55,代码来源:Dashboard.php


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