Open Journal Systems  3.3.0
RoleDAO Class Reference
Inheritance diagram for RoleDAO:
DAO

Public Member Functions

 __construct ()
 
 getAlwaysActiveStages ()
 
 getByUserId ($userId, $contextId=null)
 
 getByUserIdGroupedByContext ($userId)
 
 getForbiddenStages ($roleId=null)
 
 getUsersByRoleId ($roleId=null, $contextId=null, $searchType=null, $search=null, $searchMatch=null, $dbResultRange=null)
 
 newDataObject ()
 
 userHasRole ($contextId, $userId, $roleId)
 
- Public Member Functions inherited from DAO
 __construct ($dataSource=null, $callHooks=true)
 
 concat ()
 
 convertFromDB ($value, $type)
 
 convertToDB ($value, &$type)
 
 dateFromDB ($d)
 
 datetimeFromDB ($dt)
 
 datetimeToDB ($dt)
 
 dateToDB ($d)
 
 flushCache ()
 
 formatDateToDB ($date, $defaultNumWeeks=null, $acceptPastDate=true)
 
 getAdditionalFieldNames ()
 
 getAffectedRows ()
 
 getDataObjectSettings ($tableName, $idFieldName, $idFieldValue, $dataObject)
 
 getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getLocaleFieldNames ()
 
 getType ($value)
 
 handleError ($dataSource, $sql)
 
 nullOrInt ($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)
 

Data Fields

 $userDao
 
- Data Fields inherited from DAO
 $_dataSource
 

Additional Inherited Members

- Static Public Member Functions inherited from DAO
static getDataChangedEvent ($elementId=null, $parentElementId=null, $content='')
 
- Protected Member Functions inherited from DAO
 _getInsertId ($table='', $id='')
 

Detailed Description

Operations for retrieving and modifying Role objects.

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

Constructor & Destructor Documentation

◆ __construct()

RoleDAO::__construct ( )

Constructor.

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

References DAORegistry\getDAO().

Member Function Documentation

◆ getAlwaysActiveStages()

RoleDAO::getAlwaysActiveStages ( )

All stages are always active for these permission levels.

Returns
array array(ROLE_ID_MANAGER...);

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

◆ getByUserId()

RoleDAO::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 144 of file RoleDAO.inc.php.

References newDataObject(), and DAO\retrieve().

◆ getByUserIdGroupedByContext()

RoleDAO::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 172 of file RoleDAO.inc.php.

References DAORegistry\getDAO().

◆ getForbiddenStages()

RoleDAO::getForbiddenStages (   $roleId = null)

Get role forbidden stages.

Parameters
$roleIdint Specific role ID to fetch stages for, if any
Returns
array With $roleId, array(WORKFLOW_STAGE_ID_...); without, array(ROLE_ID_... => array(WORKFLOW_STAGE_ID_...))

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

◆ getUsersByRoleId()

RoleDAO::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 52 of file RoleDAO.inc.php.

References DAO\retrieveRange().

◆ newDataObject()

RoleDAO::newDataObject ( )

Create new data object

Returns
Role

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

Referenced by getByUserId().

◆ userHasRole()

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

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

Parameters
$contextIdint
$userIdint
$roleIdint|array ROLE_ID_...
Returns
bool True iff at least one such role exists

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

References DAO\retrieve().

Field Documentation

◆ $userDao

The RoleDAO::$userDao

User DAO to return User objects when necessary *

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


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