You are here

public function Formula::query in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/argument/Formula.php \Drupal\views\Plugin\views\argument\Formula::query()
  2. 9 core/modules/views/src/Plugin/views/argument/Formula.php \Drupal\views\Plugin\views\argument\Formula::query()

Build the query based upon the formula.

File

core/modules/views/src/Plugin/views/argument/Formula.php, line 57

Class

Formula
Argument handler for simple formulae.

Namespace

Drupal\views\Plugin\views\argument

Code

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');
}