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

Public Member Functions

 _getSearchSql ($searchType, $search, $searchMatch, &$params)
 
 _returnFromRow ($row)
 
 assignGroupToStage ($contextId, $userGroupId, $stageId)
 
 assignUserToGroup ($userId, $groupId)
 
 contextHasGroup ($contextId, $userGroupId)
 
 deleteAssignmentsByContextId ($contextId, $userId=null)
 
 deleteAssignmentsByUserGroupId ($userGroupId)
 
 deleteAssignmentsByUserId ($userId, $userGroupId=null)
 
 deleteByContextId ($contextId)
 
 deleteById ($contextId, $userGroupId)
 
 deleteObject ($userGroup)
 
 deleteSettingsByLocale ($locale)
 
 getAssignedStagesByUserGroupId ($contextId, $userGroupId)
 
 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)
 
 getIdFromPath ($stagePath)
 
 getInsertId ()
 
 getLocaleFieldNames ()
 
 getPathFromId ($stageId)
 
 getSetting ($userGroupId, $name, $locale=null)
 
 getTranslationKeyFromId ($stageId)
 
 getUserGroupIdsByRoleId ($roleId, $contextId=null)
 
 getUserGroupsByStage ($contextId, $stageId, $omitAuthors=false, $omitReviewers=false, $roleId=null)
 
 getUsersByContextId ($contextId, $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)
 
 getWorkflowStageKeysAndPaths ()
 
 insertObject ($userGroup)
 
 installLocale ($locale, $contextId=null)
 
 installSettings ($contextId, $filename)
 
 newDataObject ()
 
 removeAllStagesFromGroup ($contextId, $userGroupId)
 
 removeGroupFromStage ($contextId, $userGroupId, $stageId)
 
 removeUserFromGroup ($userId, $groupId, $contextId)
 
 updateLocaleFields ($userGroup)
 
 updateObject ($userGroup)
 
 updateSetting ($userGroupId, $name, $value, $type=null, $isLocalized=false)
 
 userAssignmentExists ($contextId, $userId, $stageId)
 
 userGroupAssignedToStage ($userGroupId, $stageId)
 
 UserGroupDAO ()
 
 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 ()
 
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 getWorkflowStageTranslationKeys ()
 
- Static Public Member Functions inherited from DAO
static getDataChangedEvent ($elementId=null, $parentElementId=null)
 

Public Attributes

 $userDao
 
 $userGroupAssignmentDao
 
- 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 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 UserGroupDAO.inc.php.

Member Function Documentation

UserGroupDAO::_getSearchSql (   $searchType,
  $search,
  $searchMatch,
$params 
)

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$paramsSQL parameter array reference

Definition at line 755 of file UserGroupDAO.inc.php.

UserGroupDAO::_returnFromRow (   $row)

Internal function to return a UserGroup object from a row.

Parameters
$rowarray
Returns
UserGroup

Definition at line 58 of file UserGroupDAO.inc.php.

UserGroupDAO::assignGroupToStage (   $contextId,
  $userGroupId,
  $stageId 
)

Assign a user group to a stage

Parameters
$contextIdint
$userGroupIdint
$stageIdint
Returns
bool

Definition at line 556 of file UserGroupDAO.inc.php.

References DAO\update().

UserGroupDAO::assignUserToGroup (   $userId,
  $groupId 
)

Assign a given user to a given user group

Parameters
int$userId
int$groupId

Definition at line 515 of file UserGroupDAO.inc.php.

UserGroupDAO::contextHasGroup (   $contextId,
  $userGroupId 
)

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

Parameters
$contextId
$userGroupId
Returns
bool

Definition at line 354 of file UserGroupDAO.inc.php.

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

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

Parameters
int$contextId
int$userId

Definition at line 506 of file UserGroupDAO.inc.php.

UserGroupDAO::deleteAssignmentsByUserGroupId (   $userGroupId)

Delete all assignments to a given user group

Parameters
unknown_type$userGroupId

Definition at line 497 of file UserGroupDAO.inc.php.

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

Delete all user group assignments for a given userId

Parameters
int$userId

Definition at line 489 of file UserGroupDAO.inc.php.

UserGroupDAO::deleteByContextId (   $contextId)

Delete a user group by its context id

Parameters
$contextIdint

Definition at line 156 of file UserGroupDAO.inc.php.

UserGroupDAO::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 134 of file UserGroupDAO.inc.php.

UserGroupDAO::deleteObject (   $userGroup)

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

Parameters
$userGroupUserGroup

Definition at line 147 of file UserGroupDAO.inc.php.

UserGroupDAO::deleteSettingsByLocale (   $locale)

Remove all settings associated with a locale

Parameters
$locale

Definition at line 744 of file UserGroupDAO.inc.php.

UserGroupDAO::getAssignedStagesByUserGroupId (   $contextId,
  $userGroupId 
)

Get all stages assigned to one user group in one context.

Parameters
Integer$contextIdThe user group context.
Integer$userGroupId

Definition at line 942 of file UserGroupDAO.inc.php.

UserGroupDAO::getByContextId (   $contextId = null)

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

Parameters
$contextId

Definition at line 376 of file UserGroupDAO.inc.php.

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

Get an individual user group

Parameters
$userGroupIdint User group ID
$contextIdint Optional context ID to use for validation

Definition at line 205 of file UserGroupDAO.inc.php.

UserGroupDAO::getByRoleId (   $contextId,
  $roleId,
  $default = false 
)

Get all user groups belonging to a role

Parameters
$contextId
$roleId
$default
Returns
DAOResultFactory

Definition at line 237 of file UserGroupDAO.inc.php.

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

Retrieve user groups to which a user is assigned.

Parameters
$userIdint
$contextIdint
Returns
DAOResultFactory

Definition at line 332 of file UserGroupDAO.inc.php.

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

Retrieve the number of users associated with the specified context.

Parameters
$contextIdint
Returns
int

Definition at line 393 of file UserGroupDAO.inc.php.

UserGroupDAO::getDefaultByRoleId (   $contextId,
  $roleId 
)

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

Parameters
$contextId
$roleId

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

UserGroupDAO::getIdFromPath (   $stagePath)

Convert a stage path into a stage id

Parameters
$stagePathstring
Returns
integer|null

Definition at line 845 of file UserGroupDAO.inc.php.

UserGroupDAO::getInsertId ( )

Get the ID of the last inserted user group.

Returns
int

Definition at line 178 of file UserGroupDAO.inc.php.

UserGroupDAO::getLocaleFieldNames ( )

Get field names for which data is localized.

Returns
array

Definition at line 186 of file UserGroupDAO.inc.php.

UserGroupDAO::getPathFromId (   $stageId)

Convert a stage id into a stage path

Parameters
$stageIdinteger
Returns
string|null

Definition at line 826 of file UserGroupDAO.inc.php.

UserGroupDAO::getSetting (   $userGroupId,
  $name,
  $locale = null 
)

Retrieve a context setting value.

Parameters
$userGroupIdint
$namestring
$localestring optional
Returns
mixed

Definition at line 627 of file UserGroupDAO.inc.php.

UserGroupDAO::getTranslationKeyFromId (   $stageId)

Convert a stage id into a stage translation key

Parameters
$stageIdinteger
Returns
string|null

Definition at line 864 of file UserGroupDAO.inc.php.

References Application\getApplicationStages(), and AppLocale\requireComponents().

UserGroupDAO::getUserGroupIdsByRoleId (   $roleId,
  $contextId = null 
)

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

Parameters
$roleIdin
$contextIdint

Definition at line 256 of file UserGroupDAO.inc.php.

UserGroupDAO::getUserGroupsByStage (   $contextId,
  $stageId,
  $omitAuthors = false,
  $omitReviewers = false,
  $roleId = null 
)

Get the user groups assigned to each stage. Provide the ability to omit authors and reviewers Since these are typically stored differently and displayed in different circumstances

Parameters
$contextId
$stageId
Returns
DAOResultFactory

Definition at line 916 of file UserGroupDAO.inc.php.

UserGroupDAO::getUsersByContextId (   $contextId,
  $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 419 of file UserGroupDAO.inc.php.

UserGroupDAO::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$userGroupIdoptional
int$contextIdoptional
string$searchType
string$search
string$searchMatch
DBResultRange$dbResultRange

Definition at line 457 of file UserGroupDAO.inc.php.

UserGroupDAO::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 429 of file UserGroupDAO.inc.php.

UserGroupDAO::getWorkflowStageKeysAndPaths ( )

Return a mapping of workflow stages, its translation keys and paths.

Returns
array

Definition at line 894 of file UserGroupDAO.inc.php.

static UserGroupDAO::getWorkflowStageTranslationKeys ( )
static

Return a mapping of workflow stages and its translation keys.

Returns
array

Definition at line 875 of file UserGroupDAO.inc.php.

UserGroupDAO::insertObject (   $userGroup)

Insert a user group.

Parameters
$userGroupUserGroup

Definition at line 79 of file UserGroupDAO.inc.php.

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

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

Parameters
$locale
$contextId

Definition at line 717 of file UserGroupDAO.inc.php.

UserGroupDAO::installSettings (   $contextId,
  $filename 
)

Load the XML file and move the settings to the DB

Parameters
$contextId
$filename

Definition at line 664 of file UserGroupDAO.inc.php.

UserGroupDAO::newDataObject ( )

create new data object (allows DAO to be subclassed)

Definition at line 49 of file UserGroupDAO.inc.php.

UserGroupDAO::removeAllStagesFromGroup (   $contextId,
  $userGroupId 
)

Delete all stage assignments in a user group.

Parameters
$contextIdint
$userGroupIdint

Definition at line 542 of file UserGroupDAO.inc.php.

References DAO\update().

UserGroupDAO::removeGroupFromStage (   $contextId,
  $userGroupId,
  $stageId 
)

Remove a user group from a stage

Parameters
$contextIdint
$userGroupIdint
$stageIdint
Returns
bool

Definition at line 570 of file UserGroupDAO.inc.php.

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

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

remove a given user from a given user group

Parameters
$userIdint
$groupIdint
$contextIdint

Definition at line 528 of file UserGroupDAO.inc.php.

UserGroupDAO::updateLocaleFields (   $userGroup)

Update the localized data for this object

Parameters
$authorobject

Definition at line 194 of file UserGroupDAO.inc.php.

UserGroupDAO::updateObject (   $userGroup)

Update a user group.

Parameters
$userGroupUserGroup

Definition at line 104 of file UserGroupDAO.inc.php.

UserGroupDAO::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 588 of file UserGroupDAO.inc.php.

UserGroupDAO::userAssignmentExists (   $contextId,
  $userId,
  $stageId 
)

Check to see whether a user is assigned to a stage ID via a user group.

Parameters
$contextIdint
$userIdint
$staeIdint
Returns
boolean

Definition at line 990 of file UserGroupDAO.inc.php.

UserGroupDAO::userGroupAssignedToStage (   $userGroupId,
  $stageId 
)

Check if a user group is assigned to a stage

Parameters
int$userGroupId
int$stageId
Returns
bool

Definition at line 968 of file UserGroupDAO.inc.php.

UserGroupDAO::UserGroupDAO ( )

Constructor.

Definition at line 39 of file UserGroupDAO.inc.php.

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

Check if a user is in any user group

Parameters
$userIdint
$contextIdint optional
Returns
boolean

Definition at line 308 of file UserGroupDAO.inc.php.

UserGroupDAO::userInGroup (   $userId,
  $userGroupId 
)

Check if a user is in a particular user group

Parameters
$contextIdint
$userIdint
$userGroupIdint
Returns
boolean

Definition at line 284 of file UserGroupDAO.inc.php.

Member Data Documentation

a UserGroupDAO::$userDao

shortcut to get the UserDAO *

Definition at line 28 of file UserGroupDAO.inc.php.

a UserGroupDAO::$userGroupAssignmentDao

shortcut to get the UserGroupAssignmentDAO *

Definition at line 34 of file UserGroupDAO.inc.php.


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