UidRevision.php

Same filename in this branch
  1. 11.x core/modules/node/src/Plugin/views/filter/UidRevision.php
Same filename in other branches
  1. 9 core/modules/node/src/Plugin/views/filter/UidRevision.php
  2. 9 core/modules/node/src/Plugin/views/argument/UidRevision.php
  3. 8.9.x core/modules/node/src/Plugin/views/filter/UidRevision.php
  4. 8.9.x core/modules/node/src/Plugin/views/argument/UidRevision.php
  5. 10 core/modules/node/src/Plugin/views/filter/UidRevision.php
  6. 10 core/modules/node/src/Plugin/views/argument/UidRevision.php

Namespace

Drupal\node\Plugin\views\argument

File

core/modules/node/src/Plugin/views/argument/UidRevision.php

View source
<?php

namespace Drupal\node\Plugin\views\argument;

use Drupal\user\Plugin\views\argument\Uid;
use Drupal\views\Attribute\ViewsArgument;

/**
 * Filter handler, accepts a user ID.
 *
 * Checks for nodes that a user posted or created a revision on.
 */
class UidRevision extends Uid {
    public function query($group_by = FALSE) {
        $this->ensureMyTable();
        $placeholder = $this->placeholder();
        $this->query
            ->addWhereExpression(0, "{$this->tableAlias}.uid = {$placeholder} OR ((SELECT COUNT(DISTINCT vid) FROM {node_revision} nr WHERE nr.revision_uid = {$placeholder} AND nr.nid = {$this->tableAlias}.nid) > 0)", [
            $placeholder => $this->argument,
        ]);
    }

}

Classes

Title Deprecated Summary
UidRevision Filter handler, accepts a user ID.

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