class UserSearch
Same name and namespace in other branches
- 11.x core/modules/user/src/Plugin/Search/UserSearch.php \Drupal\user\Plugin\Search\UserSearch
- 10 core/modules/user/src/Plugin/Search/UserSearch.php \Drupal\user\Plugin\Search\UserSearch
- 9 core/modules/user/src/Plugin/Search/UserSearch.php \Drupal\user\Plugin\Search\UserSearch
- 8.9.x core/modules/user/src/Plugin/Search/UserSearch.php \Drupal\user\Plugin\Search\UserSearch
Executes a keyword search for users against the {users} database table.
Attributes
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\DependencyInjection\AutowiredInstanceTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\search\Plugin\SearchPluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\search\Plugin\SearchInterface, \Drupal\Core\Cache\RefinableCacheableDependencyInterface uses \Drupal\Core\Cache\RefinableCacheableDependencyTrait extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\user\Plugin\Search\UserSearch implements \Drupal\Core\Access\AccessibleInterface extends \Drupal\search\Plugin\SearchPluginBase
- class \Drupal\search\Plugin\SearchPluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\search\Plugin\SearchInterface, \Drupal\Core\Cache\RefinableCacheableDependencyInterface uses \Drupal\Core\Cache\RefinableCacheableDependencyTrait extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\DependencyInjection\AutowiredInstanceTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of UserSearch
Deprecated
in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use \Drupal\search_user\Plugin\Search\SearchUser.
See also
https://www.drupal.org/node/3590230
File
-
core/
modules/ user/ src/ Plugin/ Search/ UserSearch.php, line 24
Namespace
Drupal\user\Plugin\SearchView source
class UserSearch extends SearchPluginBase implements AccessibleInterface {
/**
* The database connection.
*
* @var \Drupal\Core\Database\Connection
*/
protected $database;
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* The current user.
*
* @var \Drupal\Core\Session\AccountInterface
*/
protected $currentUser;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($container->get('database'), $container->get('entity_type.manager'), $container->get('module_handler'), $container->get('current_user'), $configuration, $plugin_id, $plugin_definition);
}
/**
* Creates a UserSearch object.
*
* @param \Drupal\Core\Database\Connection $database
* The database connection.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
* @param \Drupal\Core\Session\AccountInterface $current_user
* The current user.
* @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.
*/
public function __construct(Connection $database, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user, array $configuration, $plugin_id, $plugin_definition) {
@trigger_error(__CLASS__ . ' is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use \\Drupal\\search_user\\Plugin\\Search\\SearchUser See https://www.drupal.org/node/3590230', E_USER_DEPRECATED);
$this->database = $database;
$this->entityTypeManager = $entity_type_manager;
$this->moduleHandler = $module_handler;
$this->currentUser = $current_user;
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->addCacheTags([
'user_list',
]);
}
/**
* {@inheritdoc}
*/
public function access($operation = 'view', ?AccountInterface $account = NULL, $return_as_object = FALSE) : AccessResult {
return AccessResult::forbidden();
}
/**
* {@inheritdoc}
*/
public function execute() : array {
return [];
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.