public function ArgumentPluginBase::summaryBasics in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::summaryBasics()
Some basic summary behavior that doesn't need to be repeated as much as code that goes into summaryQuery()
4 calls to ArgumentPluginBase::summaryBasics()
- ArgumentPluginBase::summaryQuery in core/
modules/ views/ src/ Plugin/ views/ argument/ ArgumentPluginBase.php - Build the info for the summary query.
- Formula::summaryQuery in core/
modules/ views/ src/ Plugin/ views/ argument/ Formula.php - Build the summary query based on a formula.
- ManyToOne::summaryQuery in core/
modules/ views/ src/ Plugin/ views/ argument/ ManyToOne.php - Build the info for the summary query.
- StringArgument::summaryQuery in core/
modules/ views/ src/ Plugin/ views/ argument/ StringArgument.php - Build the summary query based on a string.
File
- core/
modules/ views/ src/ Plugin/ views/ argument/ ArgumentPluginBase.php, line 909
Class
- ArgumentPluginBase
- Base class for argument (contextual filter) handler plugins.
Namespace
Drupal\views\Plugin\views\argumentCode
public function summaryBasics($count_field = TRUE) {
// Add the number of nodes counter
$distinct = $this->view->display_handler
->getOption('distinct') && empty($this->query->no_distinct);
$count_alias = $this->query
->addField($this->view->storage
->get('base_table'), $this->view->storage
->get('base_field'), 'num_records', [
'count' => TRUE,
'distinct' => $distinct,
]);
$this->query
->addGroupBy($this->name_alias);
if ($count_field) {
$this->query
->setCountField($this->tableAlias, $this->realField);
}
$this->count_alias = $count_alias;
}