public function NcsLastUpdated::query

Same name in this branch
  1. 8.x drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastUpdated.php \Drupal\comment\Plugin\views\field\NcsLastUpdated::query()
  2. 8.x drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastUpdated.php \Drupal\comment\Plugin\views\sort\NcsLastUpdated::query()
  3. 8.x drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/NcsLastUpdated.php \Drupal\comment\Plugin\views\filter\NcsLastUpdated::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides Numeric::query

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/NcsLastUpdated.php, line 22
Definition of Drupal\comment\Plugin\views\filter\NcsLastUpdated.

Class

NcsLastUpdated
Filter handler for the newer of last comment / node updated.

Namespace

Drupal\comment\Plugin\views\filter

Code

public function query() {
  $this
    ->ensureMyTable();
  $this->node_table = $this->query
    ->ensure_table('node', $this->relationship);
  $field = "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)";
  $info = $this
    ->operators();
  if (!empty($info[$this->operator]['method'])) {
    $this
      ->{$info[$this->operator]['method']}($field);
  }
}