Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / views / src / Plugin / views / argument / GroupByNumeric.php
1 <?php
2
3 namespace Drupal\views\Plugin\views\argument;
4
5 /**
6  * Simple handler for arguments using group by.
7  *
8  * @ingroup views_argument_handlers
9  *
10  * @ViewsArgument("groupby_numeric")
11  */
12 class GroupByNumeric extends ArgumentPluginBase {
13
14   public function query($group_by = FALSE) {
15     $this->ensureMyTable();
16     $field = $this->getField();
17     $placeholder = $this->placeholder();
18
19     $this->query->addHavingExpression(0, "$field = $placeholder", [$placeholder => $this->argument]);
20   }
21
22   public function adminLabel($short = FALSE) {
23     return $this->getField(parent::adminLabel($short));
24   }
25
26   /**
27    * {@inheritdoc}
28    */
29   public function getSortName() {
30     return $this->t('Numerical', [], ['context' => 'Sort order']);
31   }
32
33 }