public function Formula::query in Views (for Drupal 7) 8.3
Build the query based upon the formula
Overrides ArgumentPluginBase::query
File
- lib/
Drupal/ views/ Plugin/ views/ argument/ Formula.php, line 64 - Definition of Drupal\views\Plugin\views\argument\Formula.
Class
- Formula
- Abstract 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
->get_formula() . ' = ' . $placeholder;
$placeholders = array(
$placeholder => $this->argument,
);
$this->query
->add_where(0, $formula, $placeholders, 'formula');
}