5 * Provides info about the user entity.
9 * Implements hook_entity_property_info() on top of user module.
11 * @see entity_entity_property_info()
13 function entity_metadata_user_entity_property_info() {
15 // Add meta-data about the user properties.
16 $properties = &$info['user']['properties'];
18 $properties['uid'] = array(
19 'label' => t("User ID"),
21 'description' => t("The unique ID of the user account."),
22 'schema field' => 'uid',
24 $properties['name'] = array(
26 'description' => t("The login name of the user account."),
27 'getter callback' => 'entity_metadata_user_get_properties',
28 'setter callback' => 'entity_property_verbatim_set',
29 'sanitize' => 'filter_xss',
31 'access callback' => 'entity_metadata_user_properties_access',
32 'schema field' => 'name',
34 $properties['mail'] = array(
35 'label' => t("Email"),
36 'description' => t("The email address of the user account."),
37 'setter callback' => 'entity_property_verbatim_set',
38 'validation callback' => 'valid_email_address',
40 'access callback' => 'entity_metadata_user_properties_access',
41 'schema field' => 'mail',
43 $properties['url'] = array(
45 'description' => t("The URL of the account profile page."),
46 'getter callback' => 'entity_metadata_user_get_properties',
50 $properties['edit_url'] = array(
51 'label' => t("Edit URL"),
52 'description' => t("The url of the account edit page."),
53 'getter callback' => 'entity_metadata_user_get_properties',
57 $properties['last_access'] = array(
58 'label' => t("Last access"),
59 'description' => t("The date the user last accessed the site."),
60 'getter callback' => 'entity_metadata_user_get_properties',
62 'access callback' => 'entity_metadata_user_properties_access',
63 'schema field' => 'access',
65 $properties['last_login'] = array(
66 'label' => t("Last login"),
67 'description' => t("The date the user last logged in to the site."),
68 'getter callback' => 'entity_metadata_user_get_properties',
70 'access callback' => 'entity_metadata_user_properties_access',
71 'schema field' => 'login',
73 $properties['created'] = array(
74 'label' => t("Created"),
75 'description' => t("The date the user account was created."),
77 'schema field' => 'created',
78 'setter permission' => 'administer users',
80 $properties['roles'] = array(
81 'label' => t("User roles"),
82 'description' => t("The roles of the user."),
83 'type' => 'list<integer>',
84 'getter callback' => 'entity_metadata_user_get_properties',
85 'setter callback' => 'entity_metadata_user_set_properties',
86 'options list' => 'entity_metadata_user_roles',
87 'access callback' => 'entity_metadata_user_properties_access',
89 $properties['status'] = array(
90 'label' => t("Status"),
91 'description' => t("Whether the user is active or blocked."),
92 'setter callback' => 'entity_property_verbatim_set',
93 // Although the status is expected to be boolean, its schema suggests
94 // it is an integer, so we follow the schema definition.
96 'options list' => 'entity_metadata_user_status_options_list',
97 'access callback' => 'entity_metadata_user_properties_access',
98 'schema field' => 'status',
100 $properties['theme'] = array(
101 'label' => t("Default theme"),
102 'description' => t("The user's default theme."),
103 'getter callback' => 'entity_metadata_user_get_properties',
104 'setter callback' => 'entity_property_verbatim_set',
105 'access callback' => 'entity_metadata_user_properties_access',
106 'schema field' => 'theme',