You are here

public function Formula::query in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 62
Contains \Drupal\views\Plugin\views\argument\Formula.

Class

Formula
Abstract 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 = array(
    $placeholder => $this->argument,
  );
  $this->query
    ->addWhere(0, $formula, $placeholders, 'formula');
}