UserData::get

public UserData::get($module, $uid = NULL, $name = NULL) Returns data stored for a user account. Parameters string $module: The name of the module the data is associated with. int $uid: (optional) The user account ID the data is associated with. string $name: (optional) The name of the data key. Return value mixed|array The requested user account data, depending on the arguments passed: For $module, $name, and $uid, the stored value is returned, or NULL if no value was found. For $module and

UserData

Defines the user data service. Hierarchy class \Drupal\user\UserData implements UserDataInterface File core/modules/user/src/UserData.php, line 10 Namespace Drupal\user Members Name Modifiers Type Description UserData::$connection protected property The database connection to use. UserData::delete public function Deletes data stored for a user account. Overrides UserDataInterface::delete UserData::get public function Returns data stored for a user account

UserData::set

public UserData::set($module, $uid, $name, $value) Stores data for a user account. Parameters string $module: The name of the module the data is associated with. int $uid: The user account ID the data is associated with. string $name: The name of the data key. mixed $value: The value to store. Non-scalar values are serialized automatically. Overrides UserDataInterface::set File core/modules/user/src/UserData.php, line 80 Class UserData Defines the user data service. Namespace Drupal\us

UserController::__construct

public UserController::__construct(DateFormatterInterface $date_formatter, UserStorageInterface $user_storage, UserDataInterface $user_data, LoggerInterface $logger) Constructs a UserController object. Parameters \Drupal\Core\Datetime\DateFormatterInterface $date_formatter: The date formatter service. \Drupal\user\UserStorageInterface $user_storage: The user storage. \Drupal\user\UserDataInterface $user_data: The user data service. \Psr\Log\LoggerInterface $logger: A logger instance. File core

UserController::resetPassLogin

public UserController::resetPassLogin($uid, $timestamp, $hash) Validates user, hash, and timestamp; logs the user in if correct. Parameters int $uid: User ID of the user requesting reset. int $timestamp: The current timestamp. string $hash: Login link hash. Return value \Symfony\Component\HttpFoundation\RedirectResponse Returns a redirect to the user edit form if the information is correct. If the information is incorrect redirects to 'user.pass' route with a message for the user. Throws \Sy

UserController::userTitle

public UserController::userTitle(UserInterface $user = NULL) Route title callback. Parameters \Drupal\user\UserInterface $user: The user account. Return value string|array The user account name as a render array or an empty string if $user is NULL. File core/modules/user/src/Controller/UserController.php, line 270 Class UserController Controller routines for user routes. Namespace Drupal\user\Controller Code public function userTitle(UserInterface $user = NULL) { return $user ? ['#

UserController::userPage

public UserController::userPage() Redirects users to their profile page. This controller assumes that it is only invoked for authenticated users. This is enforced for the 'user.page' route with the '_user_is_logged_in' requirement. Return value \Symfony\Component\HttpFoundation\RedirectResponse Returns a redirect to the profile of the currently logged in user. File core/modules/user/src/Controller/UserController.php, line 256 Class UserController Controller routines for user routes. Nam

UserController::create

public static UserController::create(ContainerInterface $container) Instantiates a new instance of this class. This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton. Parameters \Symfony\Component\DependencyInjection\ContainerInterface $container: The service c

UserController::resetPass

public UserController::resetPass(Request $request, $uid, $timestamp, $hash) Redirects to the user password reset form. In order to never disclose a reset link via a referrer header this controller must always return a redirect response. Parameters \Symfony\Component\HttpFoundation\Request $request: The request. int $uid: User ID of the user requesting reset. int $timestamp: The current timestamp. string $hash: Login link hash. Return value \Symfony\Component\HttpFoundation\RedirectResponse Th

UserController::logout

public UserController::logout() Logs the current user out. Return value \Symfony\Component\HttpFoundation\RedirectResponse A redirection to home page. File core/modules/user/src/Controller/UserController.php, line 280 Class UserController Controller routines for user routes. Namespace Drupal\user\Controller Code public function logout() { user_logout(); return $this->redirect('<front>'); }