public function ViewsDateFormatSqlArgument::query in Views Date Format SQL 8.3
Set up the query for this argument.
The argument sent may be found at $this->argument.
Overrides NumericArgument::query
File
- src/
Plugin/ views/ argument/ ViewsDateFormatSqlArgument.php, line 62
Class
- ViewsDateFormatSqlArgument
- An argument that filters entity timestamp field data.
Namespace
Drupal\views_date_format_sql\Plugin\views\argumentCode
public function query($group_by = FALSE) {
if (!$this->options['format_date_sql']) {
return parent::query();
}
$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');
}