ibexa

Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

member_of

Summary

Fetches the roles that are assigned to a user.

Usage

fetch( 'user', 'member_of', hash( 'id', id ) )

Parameters

NameTypeDescriptionRequired
id integer The ID number of the target user. Yes.

Returns

An array with ezrole objects or FALSE.

Description

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.

Examples

Example 1

{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.

Balazs Halasy (01/06/2004 4:27 pm)

Balazs Halasy (29/04/2005 9:32 am)


Comments

There are no comments.