Public Member Functions

RoleDAO Class Reference

Operations for retrieving and modifying Role objects. More...

List of all members.

Public Member Functions

 getByUserId ($userId, $pressId=null)
 getByUserIdGroupedByContext ($userId)
 getPressUsersRoleCount ($pressId, $roleId)
 getRoleIdFromPath ($rolePath)
 getRoleNames ($pressOnly=false, $roleIds=null)
 getSortMapping ($heading)
getUsersByRoleId ($roleId=null, $pressId=null, $searchType=null, $search=null, $searchMatch=null, $dbResultRange=null)
 RoleDAO ()
 userHasRole ($pressId, $userId, $roleId)

Detailed Description

Operations for retrieving and modifying Role objects.

See also:
Role

Definition at line 19 of file RoleDAO.inc.php.


Member Function Documentation

RoleDAO.getByUserId ( userId,
pressId = null 
)

Return an array of row objects corresponding to the roles a given use has

Parameters:
$userId 
$pressId 
Returns:
array of Roles

Definition at line 133 of file RoleDAO.inc.php.

RoleDAO.getByUserIdGroupedByContext ( userId  ) 

Return an array of objects corresponding to the roles a given user has, grouped by context id.

Parameters:
$userId int
Returns:
array

Definition at line 161 of file RoleDAO.inc.php.

RoleDAO.getPressUsersRoleCount ( pressId,
roleId 
)

Retrieve the number of users with a given role associated with the specified press.

Parameters:
$pressId int
$roleId int
Returns:
int

Definition at line 179 of file RoleDAO.inc.php.

RoleDAO.getRoleIdFromPath ( rolePath  ) 

Get a role's ID based on its path.

Parameters:
$rolePath string
Returns:
int

Definition at line 189 of file RoleDAO.inc.php.

RoleDAO.getRoleNames ( pressOnly = false,
roleIds = null 
)

Get a mapping of role keys and i18n key names.

Parameters:
boolean $pressOnly If false, also returns site-level roles (Site admin)
array $roleIds Only return role names of these IDs
Returns:
array

Definition at line 228 of file RoleDAO.inc.php.

Referenced by UserGroupForm.fetch().

RoleDAO.getSortMapping ( heading  ) 

Map a column heading value to a database value for sorting

Parameters:
string 
Returns:
string

Definition at line 213 of file RoleDAO.inc.php.

& RoleDAO.getUsersByRoleId ( roleId = null,
pressId = null,
searchType = null,
search = null,
searchMatch = null,
dbResultRange = null 
)

Retrieve a list of users in a specified role.

Parameters:
$roleId int optional (can leave as null to get all users in press)
$pressId int optional, include users only in this press
$searchType int optional, which field to search
$search string optional, string to match
$searchMatch string optional, type of match ('is' vs. 'contains' vs. 'startsWith')
$dbResultRange object DBRangeInfo object describing range of results to return
Returns:
array matching Users

Definition at line 41 of file RoleDAO.inc.php.

RoleDAO.RoleDAO (  ) 

Constructor.

Definition at line 26 of file RoleDAO.inc.php.

RoleDAO.userHasRole ( pressId,
userId,
roleId 
)

Validation check to see if a user belongs to any group that has a given role

Parameters:
$pressId 
$userId 
$roleId 
Returns:
bool

Definition at line 111 of file RoleDAO.inc.php.


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