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::$connection

The database connection to use. Type: \Drupal\Core\Database\Connection File core/modules/user/src/UserData.php, line 17 Class UserData Defines the user data service. Namespace Drupal\user Code protected $connection;

UserData::delete

public UserData::delete($module = NULL, $uid = NULL, $name = NULL) Deletes data stored for a user account. Parameters string|array $module: (optional) The name of the module the data is associated with. Can also be an array to delete the data of multiple modules. int|array $uid: (optional) The user account ID the data is associated with. If omitted, all data for $module is deleted. Can also be an array of IDs to delete the data of multiple user accounts. string $name: (optional) The name of th

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::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

UserData::__construct

public UserData::__construct(Connection $connection) Constructs a new user data service. Parameters \Drupal\Core\Database\Connection $connection: The database connection to use. File core/modules/user/src/UserData.php, line 25 Class UserData Defines the user data service. Namespace Drupal\user Code public function __construct(Connection $connection) { $this->connection = $connection; }

UserDataInterface

Defines the user data service interface. Hierarchy interface \Drupal\user\UserDataInterface File core/modules/user/src/UserDataInterface.php, line 8 Namespace Drupal\user Members Name Modifiers Type Description UserDataInterface::delete public function Deletes data stored for a user account. UserDataInterface::get public function Returns data stored for a user account. UserDataInterface::set public function Stores data for a user account.

UserDataInterface::delete

public UserDataInterface::delete($module = NULL, $uid = NULL, $name = NULL) Deletes data stored for a user account. Parameters string|array $module: (optional) The name of the module the data is associated with. Can also be an array to delete the data of multiple modules. int|array $uid: (optional) The user account ID the data is associated with. If omitted, all data for $module is deleted. Can also be an array of IDs to delete the data of multiple user accounts. string $name: (optional) The n

UserDataInterface::get

public UserDataInterface::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 $mo

UserDataInterface::set

public UserDataInterface::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. File core/modules/user/src/UserDataInterface.php, line 46 Class UserDataInterface Defines the user data service interface. Namespace Drupa