From b69517a875d0354e3d3e13df32f3ec5c8a16150b Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Fri, 11 Mar 2016 10:37:11 +0000 Subject: [PATCH] Revert "Issue #2662548 by robertwb: Support Plugins for Views Aggregate" This reverts commit 72b17f95b582f54fa631757ff2e65c84cc1ae5be. --- .../views/src/Annotation/ViewsAggregate.php | 85 ------------------- .../views/aggregate/AggregatePluginBase.php | 36 -------- .../views/src/Plugin/views/aggregate/Avg.php | 27 ------ .../src/Plugin/views/aggregate/Count.php | 28 ------ .../Plugin/views/aggregate/Count_distinct.php | 27 ------ .../views/src/Plugin/views/aggregate/Max.php | 27 ------ .../src/Plugin/views/aggregate/Median.php | 27 ------ .../views/src/Plugin/views/aggregate/Min.php | 27 ------ .../src/Plugin/views/aggregate/Stddev_Pop.php | 28 ------ .../Plugin/views/aggregate/Stddev_Samp.php | 28 ------ .../views/src/Plugin/views/aggregate/Sum.php | 27 ------ .../views/src/Plugin/views/query/Sql.php | 78 +++++++++++++++-- core/modules/views/views.services.yml | 3 - 13 files changed, 73 insertions(+), 375 deletions(-) delete mode 100644 core/modules/views/src/Annotation/ViewsAggregate.php delete mode 100644 core/modules/views/src/Plugin/views/aggregate/AggregatePluginBase.php delete mode 100644 core/modules/views/src/Plugin/views/aggregate/Avg.php delete mode 100644 core/modules/views/src/Plugin/views/aggregate/Count.php delete mode 100644 core/modules/views/src/Plugin/views/aggregate/Count_distinct.php delete mode 100644 core/modules/views/src/Plugin/views/aggregate/Max.php delete mode 100644 core/modules/views/src/Plugin/views/aggregate/Median.php delete mode 100644 core/modules/views/src/Plugin/views/aggregate/Min.php delete mode 100644 core/modules/views/src/Plugin/views/aggregate/Stddev_Pop.php delete mode 100644 core/modules/views/src/Plugin/views/aggregate/Stddev_Samp.php delete mode 100644 core/modules/views/src/Plugin/views/aggregate/Sum.php diff --git a/core/modules/views/src/Annotation/ViewsAggregate.php b/core/modules/views/src/Annotation/ViewsAggregate.php deleted file mode 100644 index 55d702e6cd8c..000000000000 --- a/core/modules/views/src/Annotation/ViewsAggregate.php +++ /dev/null @@ -1,85 +0,0 @@ -getDefinitions(); - asort($plugin_definitions); + // @todo -- need a way to get database specific and customized aggregation + // functions into here. return array( 'group' => array( 'title' => $this->t('Group results together'), 'is aggregate' => FALSE, ), - ) + $plugin_definitions; + 'count' => array( + 'title' => $this->t('Count'), + 'method' => 'aggregationMethodSimple', + 'handler' => array( + 'argument' => 'groupby_numeric', + 'field' => 'numeric', + 'filter' => 'groupby_numeric', + 'sort' => 'groupby_numeric', + ), + ), + 'count_distinct' => array( + 'title' => $this->t('Count DISTINCT'), + 'method' => 'aggregationMethodDistinct', + 'handler' => array( + 'argument' => 'groupby_numeric', + 'field' => 'numeric', + 'filter' => 'groupby_numeric', + 'sort' => 'groupby_numeric', + ), + ), + 'sum' => array( + 'title' => $this->t('Sum'), + 'method' => 'aggregationMethodSimple', + 'handler' => array( + 'argument' => 'groupby_numeric', + 'field' => 'numeric', + 'filter' => 'groupby_numeric', + 'sort' => 'groupby_numeric', + ), + ), + 'avg' => array( + 'title' => $this->t('Average'), + 'method' => 'aggregationMethodSimple', + 'handler' => array( + 'argument' => 'groupby_numeric', + 'field' => 'numeric', + 'filter' => 'groupby_numeric', + 'sort' => 'groupby_numeric', + ), + ), + 'min' => array( + 'title' => $this->t('Minimum'), + 'method' => 'aggregationMethodSimple', + 'handler' => array( + 'argument' => 'groupby_numeric', + 'field' => 'numeric', + 'filter' => 'groupby_numeric', + 'sort' => 'groupby_numeric', + ), + ), + 'max' => array( + 'title' => $this->t('Maximum'), + 'method' => 'aggregationMethodSimple', + 'handler' => array( + 'argument' => 'groupby_numeric', + 'field' => 'numeric', + 'filter' => 'groupby_numeric', + 'sort' => 'groupby_numeric', + ), + ), + 'stddev_pop' => array( + 'title' => $this->t('Standard deviation'), + 'method' => 'aggregationMethodSimple', + 'handler' => array( + 'argument' => 'groupby_numeric', + 'field' => 'numeric', + 'filter' => 'groupby_numeric', + 'sort' => 'groupby_numeric', + ), + ) + ); } public function aggregationMethodSimple($group_type, $field) { diff --git a/core/modules/views/views.services.yml b/core/modules/views/views.services.yml index a01318864ba9..1a01543c6747 100644 --- a/core/modules/views/views.services.yml +++ b/core/modules/views/views.services.yml @@ -56,9 +56,6 @@ services: plugin.manager.views.wizard: class: Drupal\views\Plugin\ViewsPluginManager arguments: [wizard, '@container.namespaces', '@cache.discovery', '@module_handler'] - plugin.manager.views.aggregate: - class: Drupal\views\Plugin\ViewsPluginManager - arguments: [aggregate, '@container.namespaces', '@cache.discovery', '@module_handler'] views.views_data: class: Drupal\views\ViewsData arguments: ['@cache.discovery', '@config.factory', '@module_handler', '@language_manager']