class StatisticsLastUpdated

Same name in this branch
  1. 9 core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php \Drupal\comment\Plugin\views\field\StatisticsLastUpdated
  2. 9 core/modules/comment/src/Plugin/views/filter/StatisticsLastUpdated.php \Drupal\comment\Plugin\views\filter\StatisticsLastUpdated
Same name and namespace in other branches
  1. 11.x core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php \Drupal\comment\Plugin\views\sort\StatisticsLastUpdated
  2. 11.x core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php \Drupal\comment\Plugin\views\field\StatisticsLastUpdated
  3. 11.x core/modules/comment/src/Plugin/views/filter/StatisticsLastUpdated.php \Drupal\comment\Plugin\views\filter\StatisticsLastUpdated

Sort handler for the newer of last comment / entity updated.

Plugin annotation

@ViewsSort("comment_ces_last_updated");

Hierarchy

Expanded class hierarchy of StatisticsLastUpdated

Related topics

File

core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php, line 14

Namespace

Drupal\comment\Plugin\views\sort
View source
class StatisticsLastUpdated extends Date {
  
  /**
   * The node table.
   */
  protected $node_table;
  
  /**
   * The field alias.
   */
  protected $field_alias;
  public function query() {
    $this->ensureMyTable();
    $this->node_table = $this->query
      ->ensureTable('node', $this->relationship);
    $this->field_alias = $this->query
      ->addOrderBy(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)", $this->options['order'], $this->tableAlias . '_' . $this->field);
  }

}

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