class Uid
Same name and namespace in other branches
- 11.x core/modules/user/src/Plugin/views/argument/Uid.php \Drupal\user\Plugin\views\argument\Uid
Argument handler to accept a user id.
Plugin annotation
@ViewsArgument("user_uid");
Hierarchy
- class \Drupal\Component\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\views\Plugin\views\HandlerBase extends \Drupal\views\Plugin\views\ViewsHandlerInterface implements \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\argument\ArgumentPluginBase extends \Drupal\Core\Cache\CacheableDependencyInterface implements \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\views\Plugin\views\argument\NumericArgument implements \Drupal\views\Plugin\views\argument\ArgumentPluginBase
- class \Drupal\user\Plugin\views\argument\Uid implements \Drupal\views\Plugin\views\argument\NumericArgument
- class \Drupal\views\Plugin\views\argument\NumericArgument implements \Drupal\views\Plugin\views\argument\ArgumentPluginBase
- class \Drupal\views\Plugin\views\argument\ArgumentPluginBase extends \Drupal\Core\Cache\CacheableDependencyInterface implements \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\views\Plugin\views\HandlerBase extends \Drupal\views\Plugin\views\ViewsHandlerInterface implements \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of Uid
Related topics
1 file declares its use of Uid
- UidRevision.php in core/
modules/ node/ src/ Plugin/ views/ argument/ UidRevision.php
209 string references to 'Uid'
- AreaDisplayLinkTest::setUp in core/
modules/ views/ tests/ src/ Kernel/ Handler/ AreaDisplayLinkTest.php - Comment::query in core/
modules/ comment/ src/ Plugin/ migrate/ source/ d6/ Comment.php - CommentAccessControlHandler::checkFieldAccess in core/
modules/ comment/ src/ CommentAccessControlHandler.php - CommentAnonymousTest::testAnonymous in core/
modules/ comment/ tests/ src/ Functional/ CommentAnonymousTest.php - Tests anonymous comment functionality.
- CommentForm::buildEntity in core/
modules/ comment/ src/ CommentForm.php - Builds an updated entity object based upon the submitted form values.
File
-
core/
modules/ user/ src/ Plugin/ views/ argument/ Uid.php, line 16
Namespace
Drupal\user\Plugin\views\argumentView source
class Uid extends NumericArgument {
/**
* The user storage.
*
* @var \Drupal\Core\Entity\EntityStorageInterface
*/
protected $storage;
/**
* Constructs a \Drupal\user\Plugin\views\argument\Uid object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityStorageInterface $storage
* The user storage.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface $storage) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->storage = $storage;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity_type.manager')
->getStorage('user'));
}
/**
* Override the behavior of title(). Get the name of the user.
*
* @return array
* A list of usernames.
*/
public function titleQuery() {
return array_map(function ($account) {
return $account->label();
}, $this->storage
->loadMultiple($this->value));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.