class GroupByNumeric in Drupal 10
Same name in this branch
- 10 core/modules/views/src/Plugin/views/filter/GroupByNumeric.php \Drupal\views\Plugin\views\filter\GroupByNumeric
- 10 core/modules/views/src/Plugin/views/sort/GroupByNumeric.php \Drupal\views\Plugin\views\sort\GroupByNumeric
- 10 core/modules/views/src/Plugin/views/argument/GroupByNumeric.php \Drupal\views\Plugin\views\argument\GroupByNumeric
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/sort/GroupByNumeric.php \Drupal\views\Plugin\views\sort\GroupByNumeric
- 9 core/modules/views/src/Plugin/views/sort/GroupByNumeric.php \Drupal\views\Plugin\views\sort\GroupByNumeric
Handler for GROUP BY on simple numeric fields.
Plugin annotation
@ViewsSort("groupby_numeric");
Hierarchy
- class \Drupal\views\Plugin\views\sort\SortPluginBase extends \Drupal\views\Plugin\views\HandlerBase implements CacheableDependencyInterface
- class \Drupal\views\Plugin\views\sort\GroupByNumeric
Expanded class hierarchy of GroupByNumeric
File
- core/
modules/ views/ src/ Plugin/ views/ sort/ GroupByNumeric.php, line 14
Namespace
Drupal\views\Plugin\views\sortView source
class GroupByNumeric extends SortPluginBase {
/**
* {@inheritdoc}
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
// Initialize the original handler.
$this->handler = Views::handlerManager('sort')
->getHandler($options);
$this->handler
->init($view, $display, $options);
}
/**
* Called to add the field to a query.
*/
public function query() {
$this
->ensureMyTable();
$params = [
'function' => $this->options['group_type'],
];
$this->query
->addOrderBy($this->tableAlias, $this->realField, $this->options['order'], NULL, $params);
}
public function adminLabel($short = FALSE) {
return $this
->getField(parent::adminLabel($short));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GroupByNumeric:: |
public | function | ||
GroupByNumeric:: |
public | function | ||
GroupByNumeric:: |
public | function |
Called to add the field to a query. Overrides SortPluginBase:: |
|
SortPluginBase:: |
public | function | Display whether or not the sort order is ascending or descending. | |
SortPluginBase:: |
public | function | ||
SortPluginBase:: |
public | function | Basic options for all sort criteria. | 2 |
SortPluginBase:: |
public | function | Determine if a sort can be exposed. | |
SortPluginBase:: |
public | function | Provide default options for exposed sorts. | |
SortPluginBase:: |
protected | function | 1 | |
SortPluginBase:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyInterface:: |
|
SortPluginBase:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyInterface:: |
|
SortPluginBase:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyInterface:: |
|
SortPluginBase:: |
public | function | Shortcut to display the expose/hide button. | |
SortPluginBase:: |
protected | function | Shortcut to display the value form. | |
SortPluginBase:: |
protected | function | Provide a list of options for the default sort form. | |
SortPluginBase:: |
public | function | ||
SortPluginBase:: |
protected | function | ||
SortPluginBase:: |
public | function | Simple submit handler. | |
SortPluginBase:: |
public static | function | ||
SortPluginBase:: |
public | function | Validate the options form. | |
SortPluginBase:: |
public | function | Simple validate handler. |