You are here

class UidRevision in Drupal 10

Same name in this branch
  1. 10 core/modules/node/src/Plugin/views/filter/UidRevision.php \Drupal\node\Plugin\views\filter\UidRevision
  2. 10 core/modules/node/src/Plugin/views/argument/UidRevision.php \Drupal\node\Plugin\views\argument\UidRevision
Same name and namespace in other branches
  1. 8 core/modules/node/src/Plugin/views/argument/UidRevision.php \Drupal\node\Plugin\views\argument\UidRevision
  2. 9 core/modules/node/src/Plugin/views/argument/UidRevision.php \Drupal\node\Plugin\views\argument\UidRevision

Filter handler to accept a user id to check for nodes that user posted or created a revision on.

Plugin annotation

@ViewsArgument("node_uid_revision");

Hierarchy

  • class \Drupal\views\Plugin\views\argument\NumericArgument extends \Drupal\views\Plugin\views\argument\ArgumentPluginBase
    • class \Drupal\user\Plugin\views\argument\Uid

Expanded class hierarchy of UidRevision

File

core/modules/node/src/Plugin/views/argument/UidRevision.php, line 13

Namespace

Drupal\node\Plugin\views\argument
View source
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,
    ]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NumericArgument::$value public property The actual value which is used for querying.
NumericArgument::buildOptionsForm public function 1
NumericArgument::defineOptions protected function 1
NumericArgument::getContextDefinition public function
NumericArgument::getSortName public function
NumericArgument::title public function 2
Uid::$storage protected property The user storage.
Uid::create public static function
Uid::titleQuery public function Override the behavior of title(). Get the name of the user. Overrides NumericArgument::titleQuery
Uid::__construct public function Constructs a \Drupal\user\Plugin\views\argument\Uid object.
UidRevision::query public function Overrides NumericArgument::query