Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
RoleDAO Class Reference
Inheritance diagram for RoleDAO:
DAO

Public Member Functions

_returnRoleFromRow (&$row)
 
 deleteRole (&$role)
 
 deleteRoleByJournalId ($journalId)
 
 deleteRoleByUserId ($userId, $journalId=null, $roleId=null)
 
getByUserIdGroupedByContext ($userId)
 
 getJournalUsersCount ($journalId, $roleId=null)
 
 getJournalUsersRoleCount ($journalId, $roleId)
 
getRole ($journalId, $userId, $roleId)
 
 getRoleIdFromPath ($rolePath)
 
 getRoleName ($roleId, $plural=false)
 
 getRolePath ($roleId)
 
getRolesByJournalId ($journalId=null, $roleId=null)
 
getRolesByUserId ($userId, $journalId=null)
 
 getSortMapping ($heading)
 
getUsersByJournalId ($journalId, $searchType=null, $search=null, $searchMatch=null, $dbResultRange=null, $sortBy=null, $sortDirection=SORT_DIRECTION_ASC)
 
getUsersByRoleId ($roleId=null, $journalId=null, $searchType=null, $search=null, $searchMatch=null, $dbResultRange=null, $sortBy=null, $sortDirection=SORT_DIRECTION_ASC)
 
 insertRole (&$role)
 
 RoleDAO ()
 
 roleExists ($journalId, $userId, $roleId)
 
 userHasRole ($journalId, $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 ()
 
 getDataChangedEvent ($elementId=null, $parentElementId=null)
 
getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getInsertId ($table= '', $id= '', $callHooks=true)
 
 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)
 

Additional Inherited Members

- Public Attributes inherited from DAO
 $_dataSource
 

Detailed Description

Operations for retrieving and modifying Role objects.

See Also
Role

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

Member Function Documentation

& RoleDAO::_returnRoleFromRow ( $row)

Internal function to return a Role object from a row.

Parameters
$rowarray
Returns
Role

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

References HookRegistry\call().

Referenced by getRole(), and getRolesByUserId().

RoleDAO::deleteRole ( $role)

Delete a role.

Parameters
$roleRole

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

References DAO\update().

RoleDAO::deleteRoleByJournalId (   $journalId)

Delete all roles for a specified journal.

Parameters
$journalIdint

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

References DAO\update().

RoleDAO::deleteRoleByUserId (   $userId,
  $journalId = null,
  $roleId = null 
)

Delete all roles for a specified journal.

Parameters
$userIdint
$journalIdint optional, include roles only in this journal
$roleIdint optional, include only this role

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

References DAO\update().

& 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 141 of file RoleDAO.inc.php.

References getRolesByUserId().

RoleDAO::getJournalUsersCount (   $journalId,
  $roleId = null 
)

Retrieve the number of users associated with the specified journal.

Parameters
$journalIdint
$roleIdint ROLE_ID_... (optional) role to count
Returns
int

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

References DAORegistry\getDAO(), and DAO\retrieve().

RoleDAO::getJournalUsersRoleCount (   $journalId,
  $roleId 
)

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

Parameters
$journalIdint
$roleIdint
Returns
int

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

References DAO\retrieve().

& RoleDAO::getRole (   $journalId,
  $userId,
  $roleId 
)

Retrieve a role.

Parameters
$journalIdint
$userIdint
$roleIdint
Returns
Role

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

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

RoleDAO::getRoleIdFromPath (   $rolePath)

Get a role's ID based on its path.

Parameters
$rolePathstring
Returns
int

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

Referenced by EditorHandler\assignEditor(), and SectionEditorSubmissionDAO\getReviewersNotAssignedToArticle().

RoleDAO::getRoleName (   $roleId,
  $plural = false 
)

Get the i18n key name associated with the specified role.

Parameters
$roleIdint
$pluralboolean get the plural form of the name
Returns
string

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

Referenced by Role\getRoleName().

RoleDAO::getRolePath (   $roleId)

Get the URL path associated with the specified role's operations.

Parameters
$roleIdint
Returns
string

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

Referenced by Role\getRolePath().

& RoleDAO::getRolesByJournalId (   $journalId = null,
  $roleId = null 
)

Select all roles for a specified journal.

Parameters
$journalIdint optional
$roleIdint optional

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

References DAO\retrieve().

& RoleDAO::getRolesByUserId (   $userId,
  $journalId = null 
)

Retrieve a list of all roles for a specified user.

Parameters
$userIdint
$journalIdint optional, include roles only in this journal
Returns
array matching Roles

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

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

Referenced by getByUserIdGroupedByContext().

RoleDAO::getSortMapping (   $heading)

Map a column heading value to a database value for sorting

Parameters
string
Returns
string

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

Referenced by getUsersByJournalId(), and getUsersByRoleId().

& RoleDAO::getUsersByJournalId (   $journalId,
  $searchType = null,
  $search = null,
  $searchMatch = null,
  $dbResultRange = null,
  $sortBy = null,
  $sortDirection = SORT_DIRECTION_ASC 
)

Retrieve a list of all users with some role in the specified journal.

Parameters
$journalIdint
$searchTypeint optional, which field to search
$searchstring optional, string to match
$searchMatchstring optional, type of match ('is' vs. 'contains' vs. 'startsWith')
$dbRangeInfoobject DBRangeInfo object describing range of results to return
Returns
array matching Users

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

References DAO\getDirectionMapping(), getSortMapping(), and DAO\retrieveRange().

& RoleDAO::getUsersByRoleId (   $roleId = null,
  $journalId = null,
  $searchType = null,
  $search = null,
  $searchMatch = null,
  $dbResultRange = null,
  $sortBy = null,
  $sortDirection = SORT_DIRECTION_ASC 
)

Retrieve a list of users in a specified role.

Parameters
$roleIdint optional (can leave as null to get all users in journal)
$journalIdint optional, include users only in this journal
$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 163 of file RoleDAO.inc.php.

References DAO\getDirectionMapping(), getSortMapping(), and DAO\retrieveRange().

RoleDAO::insertRole ( $role)

Insert a new role.

Parameters
$roleRole

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

References DAO\update().

RoleDAO::RoleDAO ( )

Constructor.

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

References DAORegistry\getDAO().

RoleDAO::roleExists (   $journalId,
  $userId,
  $roleId 
)

Validation check to see if a user belongs to any group that has a given role DEPRECATE: keeping around because HandlerValidatorRoles in pkp-lib uses until we port user groups to OxS Check if a role exists.

Parameters
$journalIdint
$userIdint
$roleIdint
Returns
boolean

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

References Config\getVar(), and userHasRole().

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

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

Parameters
$journalIdint
$userIdint
$roleIdint
Returns
boolean

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

References DAO\retrieve().

Referenced by roleExists().


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