6 * Defines the user data service interface.
8 interface UserDataInterface {
11 * Returns data stored for a user account.
13 * @param string $module
14 * The name of the module the data is associated with.
16 * (optional) The user account ID the data is associated with.
18 * (optional) The name of the data key.
21 * The requested user account data, depending on the arguments passed:
22 * - For $module, $name, and $uid, the stored value is returned, or NULL if
24 * - For $module and $uid, an associative array is returned that contains
25 * the stored data name/value pairs.
26 * - For $module and $name, an associative array is returned whose keys are
27 * user IDs and whose values contain the stored values.
28 * - For $module only, an associative array is returned that contains all
29 * existing data for $module in all user accounts, keyed first by user ID
32 public function get($module, $uid = NULL, $name = NULL);
35 * Stores data for a user account.
37 * @param string $module
38 * The name of the module the data is associated with.
40 * The user account ID the data is associated with.
42 * The name of the data key.
44 * The value to store. Non-scalar values are serialized automatically.
46 public function set($module, $uid, $name, $value);
49 * Deletes data stored for a user account.
51 * @param string|array $module
52 * (optional) The name of the module the data is associated with. Can also
53 * be an array to delete the data of multiple modules.
54 * @param int|array $uid
55 * (optional) The user account ID the data is associated with. If omitted,
56 * all data for $module is deleted. Can also be an array of IDs to delete
57 * the data of multiple user accounts.
59 * (optional) The name of the data key. If omitted, all data associated with
60 * $module and $uid is deleted.
62 public function delete($module = NULL, $uid = NULL, $name = NULL);