public function Formula::query in Drupal 8
Same name and namespace in other branches
- 9 core/modules/views/src/Plugin/views/argument/Formula.php \Drupal\views\Plugin\views\argument\Formula::query()
Build the query based upon the formula
Overrides ArgumentPluginBase::query
File
- core/
modules/ views/ src/ Plugin/ views/ argument/ Formula.php, line 57
Class
- Formula
- Argument handler for simple formulae.
Namespace
Drupal\views\Plugin\views\argumentCode
public function query($group_by = FALSE) {
$this
->ensureMyTable();
// Now that our table is secure, get our formula.
$placeholder = $this
->placeholder();
$formula = $this
->getFormula() . ' = ' . $placeholder;
$placeholders = [
$placeholder => $this->argument,
];
$this->query
->addWhere(0, $formula, $placeholders, 'formula');
}