UserUid.php

Same filename in this branch
  1. 11.x core/modules/tracker/src/Plugin/views/filter/UserUid.php
  2. 11.x core/modules/comment/src/Plugin/views/filter/UserUid.php
  3. 11.x core/modules/comment/src/Plugin/views/argument/UserUid.php
Same filename in other branches
  1. 9 core/modules/tracker/src/Plugin/views/filter/UserUid.php
  2. 9 core/modules/tracker/src/Plugin/views/argument/UserUid.php
  3. 9 core/modules/comment/src/Plugin/views/filter/UserUid.php
  4. 9 core/modules/comment/src/Plugin/views/argument/UserUid.php
  5. 8.9.x core/modules/tracker/src/Plugin/views/filter/UserUid.php
  6. 8.9.x core/modules/tracker/src/Plugin/views/argument/UserUid.php
  7. 8.9.x core/modules/comment/src/Plugin/views/filter/UserUid.php
  8. 8.9.x core/modules/comment/src/Plugin/views/argument/UserUid.php
  9. 10 core/modules/tracker/src/Plugin/views/filter/UserUid.php
  10. 10 core/modules/tracker/src/Plugin/views/argument/UserUid.php
  11. 10 core/modules/comment/src/Plugin/views/filter/UserUid.php
  12. 10 core/modules/comment/src/Plugin/views/argument/UserUid.php

Namespace

Drupal\tracker\Plugin\views\argument

File

core/modules/tracker/src/Plugin/views/argument/UserUid.php

View source
<?php

namespace Drupal\tracker\Plugin\views\argument;

use Drupal\comment\Plugin\views\argument\UserUid as CommentUserUid;

/**
 * UID argument to check for nodes that user posted or commented on.
 *
 * @ingroup views_argument_handlers
 *
 * @ViewsArgument("tracker_user_uid")
 */
class UserUid extends CommentUserUid {
    
    /**
     * {@inheritdoc}
     */
    public function query($group_by = FALSE) {
        // Because this handler thinks it's an argument for a field on the {node}
        // table, we need to make sure {tracker_user} is JOINed and use its alias
        // for the WHERE clause.
        $tracker_user_alias = $this->query
            ->ensureTable('tracker_user');
        $this->query
            ->addWhere(0, "{$tracker_user_alias}.uid", $this->argument);
    }

}

Classes

Title Deprecated Summary
UserUid UID argument to check for nodes that user posted or commented on.

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