.

UserRoles Class Reference
[Usermanagement]

Helpers for user role retrieval. More...

List of all members.

Static Public Member Functions

static  get_by_name ($name)
  Returns user role by name.
static  get_for_user ($user_id)
  Return all roles for given user.

Detailed Description

Helpers for user role retrieval.

Author:
Gerd Riesselmann

Definition at line 8 of file userroles.facade.php.


Member Function Documentation

static UserRoles::get_by_name ( name  )  [static]

Returns user role by name.

Parameters:
string  $name
Returns:
DAOUserRoles

Definition at line 15 of file userroles.facade.php.

00015                                                   {
00016                 return DB::get_item('userroles', 'name', $name);         
00017         }
static UserRoles::get_for_user ( user_id  )  [static]

Return all roles for given user.

Parameters:
int  $user_id
Returns:
array

Definition at line 25 of file userroles.facade.php.

00025                                                       {
00026                 $dao = new DAOUserroles();
00027                 $link = new DAOUsers2userroles();
00028                 $link->id_user = $user_id;
00029                 
00030                 $dao->join($link);
00031                 return $dao->find_array();
00032         }

The documentation for this class was generated from the following file: