fetch( 'user', 'member_of', hash( 'id', id ) )
Name | Type | Description | Required |
---|---|---|---|
id | integer | The ID number of the target user. | Yes. |
An array with ezrole objects or FALSE.
This function will fetch the roles that are assigned to a user. The desired user's ID number must be specified using the "id" parameter. The function will return an array of ezrole objects. If no roles are associated with the user, or if an invalid user ID is provided, the function will return FALSE.
{def $roles=fetch( 'user', 'member_of', hash( 'id', 42 ) )} {foreach $roles as $role} {$role.name} <br /> {/foreach}
Outputs the names of the roles that are assigned to user number 42.
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.