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

Public Member Functions

 _getSearchSql ($searchType, $search, $searchMatch, &$paramArray)
 
_returnFromRow (&$row)
 
 assignUserToGroup ($userId, $groupId)
 
 contextHasGroup ($contextId, $userGroupId)
 
 deleteAssignmentsByContextId ($contextId, $userId=null)
 
 deleteAssignmentsByUserGroupId ($userGroupId)
 
 deleteAssignmentsByUserId ($userId, $userGroupId=null)
 
 deleteByContextId ($contextId)
 
 deleteById ($contextId, $userGroupId)
 
 deleteSettingsByLocale ($locale)
 
 deleteUserGroup (&$userGroup)
 
getByContextId ($contextId=null)
 
 getById ($userGroupId, $contextId=null)
 
getByRoleId ($contextId, $roleId, $default=false)
 
getByUserId ($userId, $contextId=null)
 
 getContextUsersCount ($contextId, $userGroupId=null, $roleId=null)
 
getDefaultByRoleId ($contextId, $roleId)
 
 getInsertUserGroupId ()
 
 getLocaleFieldNames ()
 
getSetting ($userGroupId, $name, $locale=null)
 
getUserGroupIdsByRoleId ($roleId, $contextId=null)
 
getUsersByContextId ($contextId=null, $searchType=null, $search=null, $searchMatch=null, $dbResultRange=null)
 
getUsersById ($userGroupId=null, $contextId=null, $searchType=null, $search=null, $searchMatch=null, $dbResultRange=null)
 
getUsersNotInRole ($roleId, $contextId=null, $search=null)
 
getUsersWithNoUserGroupAssignments ($filter=null, $allowDisabled=true, $dbResultRange=null)
 
 insertUserGroup (&$userGroup)
 
 installLocale ($locale, $contextId=null)
 
 installSettings ($contextId, $filename)
 
newDataObject ()
 
 PKPUserGroupDAO ()
 
 removeAllStagesFromGroup ($contextId, $userGroupId)
 
 removeUserFromGroup ($userId, $groupId, $contextId)
 
 updateLocaleFields (&$userGroup)
 
 updateSetting ($userGroupId, $name, $value, $type=null, $isLocalized=false)
 
 userInAnyGroup ($userId, $contextId=null)
 
 userInGroup ($userId, $userGroupId)
 
- 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 User Groups and user group assignments FIXME: Some of the context-specific features of this class will have to be changed for zero- or double-context applications when user groups are ported over to them.

See Also
UserGroup

Definition at line 23 of file PKPUserGroupDAO.inc.php.

Member Function Documentation

PKPUserGroupDAO::_getSearchSql (   $searchType,
  $search,
  $searchMatch,
$paramArray 
)

private function to assemble the SQL for searching users.

Parameters
string$searchTypethe field to search on.
string$searchthe keywords to search for.
string$searchMatchwhere to match (is, contains, startsWith).
array$paramArraySQL parameter array reference

Definition at line 752 of file PKPUserGroupDAO.inc.php.

Referenced by getUsersById(), and getUsersWithNoUserGroupAssignments().

& PKPUserGroupDAO::_returnFromRow ( $row)

Internal function to return a UserGroup object from a row.

Parameters
$rowarray
Returns
PKPUserGroup

Definition at line 53 of file PKPUserGroupDAO.inc.php.

References HookRegistry\call(), and newDataObject().

Referenced by getById().

PKPUserGroupDAO::assignUserToGroup (   $userId,
  $groupId 
)

Assign a given user to a given user group

Parameters
int$userId
int$groupId

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

PKPUserGroupDAO::contextHasGroup (   $contextId,
  $userGroupId 
)

Validation check to see if user group exists for a given context

Parameters
$contextId
$userGroupId
Returns
bool

Definition at line 327 of file PKPUserGroupDAO.inc.php.

References DAO\retrieve().

PKPUserGroupDAO::deleteAssignmentsByContextId (   $contextId,
  $userId = null 
)

Remove all user group assignments for a given user in a context

Parameters
int$contextId
int$userId

Definition at line 529 of file PKPUserGroupDAO.inc.php.

PKPUserGroupDAO::deleteAssignmentsByUserGroupId (   $userGroupId)

Delete all assignments to a given user group

Parameters
unknown_type$userGroupId

Definition at line 520 of file PKPUserGroupDAO.inc.php.

PKPUserGroupDAO::deleteAssignmentsByUserId (   $userId,
  $userGroupId = null 
)

Delete all user group assignments for a given userId

Parameters
int$userId

Definition at line 512 of file PKPUserGroupDAO.inc.php.

PKPUserGroupDAO::deleteByContextId (   $contextId)

Delete a user group by its context id

Parameters
$contextIdint

Definition at line 119 of file PKPUserGroupDAO.inc.php.

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

PKPUserGroupDAO::deleteById (   $contextId,
  $userGroupId 
)

Delete a user group by its id will also delete related settings and all the assignments to this group

Parameters
$contextIdint
$userGroupIdint

Definition at line 97 of file PKPUserGroupDAO.inc.php.

References removeAllStagesFromGroup(), and DAO\update().

Referenced by deleteUserGroup().

PKPUserGroupDAO::deleteSettingsByLocale (   $locale)

Remove all settings associated with a locale

Parameters
$locale

Definition at line 740 of file PKPUserGroupDAO.inc.php.

References DAO\update().

PKPUserGroupDAO::deleteUserGroup ( $userGroup)

Delete a user group. will also delete related settings and all the assignments to this group

Parameters
$userGroupUserGroup

Definition at line 110 of file PKPUserGroupDAO.inc.php.

References deleteById().

& PKPUserGroupDAO::getByContextId (   $contextId = null)

Retrieve user groups for a given context (all contexts if null)

Parameters
$contextId

Definition at line 351 of file PKPUserGroupDAO.inc.php.

References DAO\retrieve().

Referenced by installLocale().

PKPUserGroupDAO::getById (   $userGroupId,
  $contextId = null 
)

Get an individual user group

Parameters
$userGroupId
$contextId

Definition at line 168 of file PKPUserGroupDAO.inc.php.

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

& PKPUserGroupDAO::getByRoleId (   $contextId,
  $roleId,
  $default = false 
)

Get all user groups belonging to a role

Parameters
$contextId
$roleId
$default
Returns
DAOResultFactory

Definition at line 202 of file PKPUserGroupDAO.inc.php.

References DAO\retrieve().

Referenced by getDefaultByRoleId().

& PKPUserGroupDAO::getByUserId (   $userId,
  $contextId = null 
)

Retrieve user groups to which a user is assigned.

Parameters
$userIdint
$contextIdint
Returns
DAOResultFactory

Definition at line 304 of file PKPUserGroupDAO.inc.php.

References DAO\retrieve().

PKPUserGroupDAO::getContextUsersCount (   $contextId,
  $userGroupId = null,
  $roleId = null 
)

Retrieve the number of users associated with the specified context.

Parameters
$contextIdint
Returns
int

Definition at line 369 of file PKPUserGroupDAO.inc.php.

References DAO\retrieve().

& PKPUserGroupDAO::getDefaultByRoleId (   $contextId,
  $roleId 
)

Get a single default user group with a particular roleId FIXME: ??

Parameters
$contextId
$roleId

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

References getByRoleId().

PKPUserGroupDAO::getInsertUserGroupId ( )

Get the ID of the last inserted user group.

Returns
int

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

References DAO\getInsertId().

Referenced by insertUserGroup().

PKPUserGroupDAO::getLocaleFieldNames ( )

Get field names for which data is localized.

Returns
array

Definition at line 149 of file PKPUserGroupDAO.inc.php.

& PKPUserGroupDAO::getSetting (   $userGroupId,
  $name,
  $locale = null 
)

Retrieve a context setting value.

Parameters
$userGroupIdint
$namestring
$localestring optional
Returns
mixed

Definition at line 624 of file PKPUserGroupDAO.inc.php.

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

Referenced by installLocale().

& PKPUserGroupDAO::getUserGroupIdsByRoleId (   $roleId,
  $contextId = null 
)

Get an array of user group ids belonging to a given role

Parameters
$roleIdin
$contextIdint

Definition at line 222 of file PKPUserGroupDAO.inc.php.

References DAO\retrieve().

& PKPUserGroupDAO::getUsersByContextId (   $contextId = null,
  $searchType = null,
  $search = null,
  $searchMatch = null,
  $dbResultRange = null 
)

return an Iterator of User objects given the search parameters

Parameters
int$contextId
string$searchType
string$search
string$searchMatch
DBResultRange$dbResultRange

Definition at line 397 of file PKPUserGroupDAO.inc.php.

References getUsersById().

& PKPUserGroupDAO::getUsersById (   $userGroupId = null,
  $contextId = null,
  $searchType = null,
  $search = null,
  $searchMatch = null,
  $dbResultRange = null 
)

return an Iterator of User objects given the search parameters

Parameters
int$userGroupId
int$contextId
string$searchType
string$search
string$searchMatch
DBResultRange$dbResultRange

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

References _getSearchSql(), and DAO\retrieveRange().

Referenced by getUsersByContextId().

& PKPUserGroupDAO::getUsersNotInRole (   $roleId,
  $contextId = null,
  $search = null 
)

Find users that don't have a given role

Parameters
$contextIdint optional
ROLE_ID_...int (const)
$searchstring

Definition at line 407 of file PKPUserGroupDAO.inc.php.

References DAO\retrieve().

& PKPUserGroupDAO::getUsersWithNoUserGroupAssignments (   $filter = null,
  $allowDisabled = true,
  $dbResultRange = null 
)

Retrieve those users with no group assignments in any press.

Parameters
array$filteran array of search critera
boolean$allowDisabled
DBResultRarnge$dbResultRange
Returns
DAOResultFactory

Definition at line 477 of file PKPUserGroupDAO.inc.php.

References _getSearchSql(), and DAO\retrieveRange().

PKPUserGroupDAO::insertUserGroup ( $userGroup)

Insert a user group.

Parameters
$userGroupUserGroup

Definition at line 72 of file PKPUserGroupDAO.inc.php.

References getInsertUserGroupId(), DAO\update(), and updateLocaleFields().

Referenced by installSettings().

PKPUserGroupDAO::installLocale (   $locale,
  $contextId = null 
)

use the locale keys stored in the settings table to install the locale settings

Parameters
$locale
$contextId

Definition at line 711 of file PKPUserGroupDAO.inc.php.

References getByContextId(), getSetting(), and updateSetting().

Referenced by installSettings().

PKPUserGroupDAO::installSettings (   $contextId,
  $filename 
)

Load the XML file and move the settings to the DB

Parameters
$contextId
$filename

Definition at line 662 of file PKPUserGroupDAO.inc.php.

References AppLocale\getLocale(), insertUserGroup(), installLocale(), newDataObject(), and updateSetting().

& PKPUserGroupDAO::newDataObject ( )

create new data object (allows DAO to be subclassed)

Definition at line 43 of file PKPUserGroupDAO.inc.php.

Referenced by _returnFromRow(), and installSettings().

PKPUserGroupDAO::PKPUserGroupDAO ( )

Constructor.

Definition at line 33 of file PKPUserGroupDAO.inc.php.

References DAORegistry\getDAO().

PKPUserGroupDAO::removeAllStagesFromGroup (   $contextId,
  $userGroupId 
)

Delete all stage assignments in a user group.

Parameters
$contextIdint
$userGroupIdint

Definition at line 566 of file PKPUserGroupDAO.inc.php.

Referenced by deleteById().

PKPUserGroupDAO::removeUserFromGroup (   $userId,
  $groupId,
  $contextId 
)

remove a given user from a given user group

Parameters
$userIdint
$groupIdint
$contextIdint

Definition at line 551 of file PKPUserGroupDAO.inc.php.

PKPUserGroupDAO::updateLocaleFields ( $userGroup)

Update the localized data for this object

Parameters
$authorobject

Definition at line 157 of file PKPUserGroupDAO.inc.php.

References DAO\updateDataObjectSettings().

Referenced by insertUserGroup().

PKPUserGroupDAO::updateSetting (   $userGroupId,
  $name,
  $value,
  $type = null,
  $isLocalized = false 
)

Method for updatea userGroup setting

Parameters
$userGroupIdint
$namestring
$valuemixed
$typestring data type of the setting. If omitted, type will be guessed
$isLocalizedboolean

Definition at line 585 of file PKPUserGroupDAO.inc.php.

References DAO\convertToDB(), DAO\replace(), and DAO\update().

Referenced by installLocale(), and installSettings().

PKPUserGroupDAO::userInAnyGroup (   $userId,
  $contextId = null 
)

Check if a user is in any user group

Parameters
$userIdint
$contextIdint optional
Returns
boolean

Definition at line 278 of file PKPUserGroupDAO.inc.php.

References DAO\retrieve().

PKPUserGroupDAO::userInGroup (   $userId,
  $userGroupId 
)

Check if a user is in a particular user group

Parameters
$contextIdint
$userIdint
$userGroupIdint
Returns
boolean

Definition at line 252 of file PKPUserGroupDAO.inc.php.

References DAO\retrieve().


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