"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/modules/node/src/Plugin/views/filter/UidRevision.php" (26 Nov 2020, 739 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "UidRevision.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 namespace Drupal\node\Plugin\views\filter;
    4 
    5 use Drupal\user\Plugin\views\filter\Name;
    6 
    7 /**
    8  * Filter handler to check for revisions a certain user has created.
    9  *
   10  * @ingroup views_filter_handlers
   11  *
   12  * @ViewsFilter("node_uid_revision")
   13  */
   14 class UidRevision extends Name {
   15 
   16   public function query($group_by = FALSE) {
   17     $this->ensureMyTable();
   18 
   19     $placeholder = $this->placeholder() . '[]';
   20 
   21     $args = array_values($this->value);
   22 
   23     $this->query->addWhereExpression($this->options['group'], "$this->tableAlias.uid IN($placeholder) OR
   24       ((SELECT COUNT(DISTINCT vid) FROM {node_revision} nr WHERE nr.revision_uid IN ($placeholder) AND nr.nid = $this->tableAlias.nid) > 0)", [$placeholder => $args],
   25       $args);
   26   }
   27 
   28 }