Skip to content

An example of how to store and retrieve complex variables in the user data column.

License

Notifications You must be signed in to change notification settings

martsie/drupal-user-data-example

Repository files navigation

Drupal User data - how to store user specific content without fields

All accompanying code for the tutorial available at http://www.codesidekick.com/blog/user-data-how-store-user-specific-content-without-fields.

Usage

Set data to the user object.

global $user;
$account = entity_metadata_wrapper('user', $user);
$account->employee_number->set(60000);
entity_save('user', $account);

Get data from the user object.

global $user;
$account = entity_metadata_wrapper('user', $user);
$employee_number = $account->employee_number->value();

About

An example of how to store and retrieve complex variables in the user data column.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published