function Formula::query

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/argument/Formula.php \Drupal\views\Plugin\views\argument\Formula::query()
  2. 8.9.x core/modules/views/src/Plugin/views/argument/Formula.php \Drupal\views\Plugin\views\argument\Formula::query()
  3. 11.x 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 59

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.