Drupal 8  8.0.2
UserSearch Class Reference
Inheritance diagram for UserSearch:

Public Member Functions

 __construct (Connection $database, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user, array $configuration, $plugin_id, $plugin_definition)
 
 access ($operation= 'view', AccountInterface $account=NULL, $return_as_object=FALSE)
 
 execute ()
 
 getHelp ()
 
- Public Member Functions inherited from SearchPluginBase
 setSearch ($keywords, array $parameters, array $attributes)
 
 getKeywords ()
 
 getParameters ()
 
 getAttributes ()
 
 isSearchExecutable ()
 
 getType ()
 
 buildResults ()
 
 searchFormAlter (array &$form, FormStateInterface $form_state)
 
 suggestedTitle ()
 
 buildSearchUrlQuery (FormStateInterface $form_state)
 
 getHelp ()
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 
- Public Member Functions inherited from CacheableDependencyInterface
 getCacheContexts ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 
- Static Public Member Functions inherited from SearchPluginBase
static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Attributes

 $database
 
 $entityManager
 
 $moduleHandler
 
 $currentUser
 
- Protected Attributes inherited from SearchPluginBase
 $keywords
 
 $searchParameters
 
 $searchAttributes
 

Detailed Description

Executes a keyword search for users against the {users} database table.

( id = "user_search", title = ("Users") )

Constructor & Destructor Documentation

__construct ( Connection  $database,
EntityManagerInterface  $entity_manager,
ModuleHandlerInterface  $module_handler,
AccountInterface  $current_user,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)

Creates a UserSearch object.

Parameters
Connection$databaseThe database connection.
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
ModuleHandlerInterface$module_handlerThe module handler.
\Drupal\Core\Session\AccountInterface$current_userThe current user.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin_id for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.

References RefinableCacheableDependencyInterface\addCacheTags(), Drupal\currentUser(), Drupal\database(), Drupal\entityManager(), and Drupal\moduleHandler().

Here is the call graph for this function:

Member Function Documentation

access (   $operation = 'view',
AccountInterface  $account = NULL,
  $return_as_object = FALSE 
)

{Checks data value access.

Parameters
string$operationThe operation to be performed.
\Drupal\Core\Session\AccountInterface$account(optional) The user for which to check access, or NULL to check access for the current user. Defaults to NULL.
bool$return_as_object(optional) Defaults to FALSE.
Returns
bool| The access result. Returns a boolean if $return_as_object is FALSE (this is the default) and otherwise an AccessResultInterface object. When a boolean is returned, the result of AccessInterface::isAllowed() is returned, i.e. TRUE means access is explicitly allowed, FALSE means access is either explicitly forbidden or "no opinion".
}

Implements AccessibleInterface.

References AccessResult\allowedIf().

Here is the call graph for this function:

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

execute ( )

{Executes the search.

Returns
array A structured list of search results.
}

Implements SearchInterface.

References RefinableCacheableDependencyInterface\addCacheableDependency(), Drupal\currentUser(), Drupal\database(), Drupal\entityManager(), and SearchPluginBase\isSearchExecutable().

Here is the call graph for this function:

getHelp ( )

Returns the searching help.

Returns
array Render array for the searching help.

Implements SearchInterface.

References t().

Here is the call graph for this function:


The documentation for this class was generated from the following file: