You are here

class StatisticsLastUpdated in Drupal 10

Same name in this branch
  1. 10 core/modules/comment/src/Plugin/views/filter/StatisticsLastUpdated.php \Drupal\comment\Plugin\views\filter\StatisticsLastUpdated
  2. 10 core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php \Drupal\comment\Plugin\views\sort\StatisticsLastUpdated
  3. 10 core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php \Drupal\comment\Plugin\views\field\StatisticsLastUpdated
Same name and namespace in other branches
  1. 8 core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php \Drupal\comment\Plugin\views\sort\StatisticsLastUpdated
  2. 9 core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php \Drupal\comment\Plugin\views\sort\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 {
  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);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Date::buildOptionsForm public function Basic options for all sort criteria. Overrides SortPluginBase::buildOptionsForm
Date::defineOptions protected function Overrides SortPluginBase::defineOptions
SortPluginBase::adminSummary public function Display whether or not the sort order is ascending or descending.
SortPluginBase::buildExposeForm public function
SortPluginBase::canExpose public function Determine if a sort can be exposed.
SortPluginBase::defaultExposeOptions public function Provide default options for exposed sorts.
SortPluginBase::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyInterface::getCacheContexts
SortPluginBase::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyInterface::getCacheMaxAge
SortPluginBase::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyInterface::getCacheTags
SortPluginBase::showExposeButton public function Shortcut to display the expose/hide button.
SortPluginBase::showSortForm protected function Shortcut to display the value form.
SortPluginBase::sortOptions protected function Provide a list of options for the default sort form.
SortPluginBase::sortSubmit public function
SortPluginBase::sortValidate protected function
SortPluginBase::submitOptionsForm public function Simple submit handler.
SortPluginBase::trustedCallbacks public static function
SortPluginBase::validateExposeForm public function Validate the options form.
SortPluginBase::validateOptionsForm public function Simple validate handler.
StatisticsLastUpdated::query public function Called to add the sort to a query. Overrides Date::query