You are here

public function Date::query in CiviCRM Entity 8.3

Build the query based upon the formula

Overrides Formula::query

File

src/Plugin/views/argument/Date.php, line 43

Class

Date
Argument handler for CiviCRM dates.

Namespace

Drupal\civicrm_entity\Plugin\views\argument

Code

public function query($group_by = FALSE) {
  $this
    ->ensureMyTable();

  // Override the query so we can use a simple expression rather than
  // placeholders.
  $value = $this->query
    ->getDateFormat($this->query
    ->getDateField("'" . $this->argument . "'", TRUE, FALSE), $this->argFormat);
  $this->query
    ->addWhereExpression(0, "{$this->getFormula()} = {$value}");
}