Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
PKPRoleDAO Class Reference
Inheritance diagram for PKPRoleDAO:
DAO RoleDAO

Public Member Functions

 getByUserId ($userId, $contextId=null)
 
 getByUserIdGroupedByContext ($userId)
 
 getRoleIdFromPath ($rolePath)
 
 getSortMapping ($heading)
 
 getUsersByRoleId ($roleId=null, $contextId=null, $searchType=null, $search=null, $searchMatch=null, $dbResultRange=null)
 
 newDataObject ()
 
 PKPRoleDAO ()
 
 userHasRole ($contextId, $userId, $roleId)
 
- Public Member Functions inherited from DAO
 concat ()
 
 convertFromDB ($value, $type)
 
 convertToDB ($value, &$type)
 
 DAO ($dataSource=null, $callHooks=true)
 
 dateFromDB ($d)
 
 datetimeFromDB ($dt)
 
 datetimeToDB ($dt)
 
 dateToDB ($d)
 
 flushCache ()
 
 formatDateToDB ($date, $defaultNumWeeks=null, $acceptPastDate=true)
 
 getAffectedRows ()
 
getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getType ($value)
 
 replace ($table, $arrFields, $keyCols)
 
retrieve ($sql, $params=false, $callHooks=true)
 
retrieveCached ($sql, $params=false, $secsToCache=3600, $callHooks=true)
 
retrieveLimit ($sql, $params=false, $numRows=false, $offset=false, $callHooks=true)
 
retrieveRange ($sql, $params=false, $dbResultRange=null, $callHooks=true)
 
 setCacheDir ()
 
 setDataSource (&$dataSource)
 
 update ($sql, $params=false, $callHooks=true, $dieOnError=true)
 
 updateDataObjectSettings ($tableName, &$dataObject, $idArray)
 

Static Public Member Functions

static getRoleNames ($contextOnly=false)
 
- Static Public Member Functions inherited from DAO
static getDataChangedEvent ($elementId=null, $parentElementId=null)
 

Public Attributes

 $userDao
 
- Public Attributes inherited from DAO
 $_dataSource
 

Additional Inherited Members

- Protected Member Functions inherited from DAO
 _getInsertId ($table= '', $id= '')
 

Detailed Description

Operations for retrieving and modifying Role objects.

See Also
PKPRole

Definition at line 20 of file PKPRoleDAO.inc.php.

Member Function Documentation

PKPRoleDAO::getByUserId (   $userId,
  $contextId = null 
)

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

Parameters
$userId
$contextId
Returns
array of Roles

Definition at line 141 of file PKPRoleDAO.inc.php.

PKPRoleDAO::getByUserIdGroupedByContext (   $userId)

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

Parameters
$userIdint
Returns
array

Definition at line 167 of file PKPRoleDAO.inc.php.

PKPRoleDAO::getRoleIdFromPath (   $rolePath)

Get a role's ID based on its path.

Parameters
$rolePathstring
Returns
int

Definition at line 187 of file PKPRoleDAO.inc.php.

static PKPRoleDAO::getRoleNames (   $contextOnly = false)
static

Get a mapping of role keys and i18n key names.

Parameters
boolean$contextOnlyIf false, also returns site-level roles (Site admin)
Returns
array

Definition at line 224 of file PKPRoleDAO.inc.php.

PKPRoleDAO::getSortMapping (   $heading)

Map a column heading value to a database value for sorting

Parameters
string
Returns
string

Definition at line 209 of file PKPRoleDAO.inc.php.

PKPRoleDAO::getUsersByRoleId (   $roleId = null,
  $contextId = null,
  $searchType = null,
  $search = null,
  $searchMatch = null,
  $dbResultRange = null 
)

Retrieve a list of users in a specified role.

Parameters
$roleIdint optional (can leave as null to get all users in context)
$contextIdint optional, include users only in this context
$searchTypeint optional, which field to search
$searchstring optional, string to match
$searchMatchstring optional, type of match ('is' vs. 'contains' vs. 'startsWith')
$dbResultRangeobject DBRangeInfo object describing range of results to return
Returns
array matching Users

Definition at line 54 of file PKPRoleDAO.inc.php.

PKPRoleDAO::newDataObject ( )

create new data object (allows DAO to be subclassed)

Returns
PKPRole

Definition at line 40 of file PKPRoleDAO.inc.php.

PKPRoleDAO::PKPRoleDAO ( )

Constructor.

Definition at line 30 of file PKPRoleDAO.inc.php.

PKPRoleDAO::userHasRole (   $contextId,
  $userId,
  $roleId 
)

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

Parameters
$contextId
$userId
$roleId
Returns
bool

Definition at line 121 of file PKPRoleDAO.inc.php.

Member Data Documentation

The PKPRoleDAO::$userDao

User DAO to return User objects when necessary *

Definition at line 25 of file PKPRoleDAO.inc.php.


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