Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / history / src / Plugin / views / filter / HistoryUserTimestamp.php
index 92a57991ca7bfc7aa6c491542a61efeb1972b20f..02288da1c4f24079ca95276be8cf26b0456a8c5a 100644 (file)
@@ -20,7 +20,9 @@ class HistoryUserTimestamp extends FilterPluginBase {
 
   use UncacheableDependencyTrait;
 
-  // Don't display empty space where the operator would be.
+  /**
+   * {@inheritdoc}
+   */
   public $no_operator = TRUE;
 
   /**
@@ -30,6 +32,9 @@ class HistoryUserTimestamp extends FilterPluginBase {
     return FALSE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function buildExposeForm(&$form, FormStateInterface $form_state) {
     parent::buildExposeForm($form, $form_state);
     // @todo There are better ways of excluding required and multiple (object flags)
@@ -38,6 +43,9 @@ class HistoryUserTimestamp extends FilterPluginBase {
     unset($form['expose']['remember']);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   protected function valueForm(&$form, FormStateInterface $form_state) {
     // Only present a checkbox for the exposed filter itself. There's no way
     // to tell the difference between not checked and the default value, so
@@ -57,6 +65,9 @@ class HistoryUserTimestamp extends FilterPluginBase {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function query() {
     // This can only work if we're authenticated in.
     if (!\Drupal::currentUser()->isAuthenticated()) {
@@ -70,7 +81,6 @@ class HistoryUserTimestamp extends FilterPluginBase {
 
     // Hey, Drupal kills old history, so nodes that haven't been updated
     // since HISTORY_READ_LIMIT are bzzzzzzzt outta here!
-
     $limit = REQUEST_TIME - HISTORY_READ_LIMIT;
 
     $this->ensureMyTable();
@@ -79,9 +89,9 @@ class HistoryUserTimestamp extends FilterPluginBase {
 
     $clause = '';
     $clause2 = '';
-    if ($ces = $this->query->ensureTable('comment_entity_statistics', $this->relationship)) {
-      $clause = ("OR $ces.last_comment_timestamp > (***CURRENT_TIME*** - $limit)");
-      $clause2 = "OR $field < $ces.last_comment_timestamp";
+    if ($alias = $this->query->ensureTable('comment_entity_statistics', $this->relationship)) {
+      $clause = "OR $alias.last_comment_timestamp > (***CURRENT_TIME*** - $limit)";
+      $clause2 = "OR $field < $alias.last_comment_timestamp";
     }
 
     // NULL means a history record doesn't exist. That's clearly new content.
@@ -90,6 +100,9 @@ class HistoryUserTimestamp extends FilterPluginBase {
     $this->query->addWhereExpression($this->options['group'], "($field IS NULL AND ($node.changed > (***CURRENT_TIME*** - $limit) $clause)) OR $field < $node.changed $clause2");
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function adminSummary() {
     if (!empty($this->options['exposed'])) {
       return $this->t('exposed');