UserGroupsVariable
- Type
- Class
- Namespace
- Craft
- Inherits
- Craft\UserGroupsVariable
- Since
- 1.0
User group functions.
See also http://craftcms.com
View source (opens new window)
# Public Methods
Method | Description |
---|---|
getAllGroups() | Returns all user groups. |
getAssignableGroups() | Returns the user groups that the current user is allowed to assign to another user. |
getGroupByHandle() | Gets a user group by its handle. |
getGroupById() | Gets a user group by its ID. |
# getAllGroups()
Returns all user groups.
View source (opens new window)
Arguments
$indexBy
(string (opens new window), null (opens new window))
Returns
Signature
public Craft\UserGroupModel[] getAllGroups ( $indexBy = null )
# getAssignableGroups()
Returns the user groups that the current user is allowed to assign to another user.
View source (opens new window)
Arguments
$user
(Craft\UserModel, null (opens new window)) – The recipient of the user groups. If set, their current groups will be included as well.
Returns
Signature
public Craft\UserGroupModel[] getAssignableGroups ( Craft\UserModel $user = null )
# getGroupByHandle()
Gets a user group by its handle.
View source (opens new window)
Arguments
$groupHandle
(string (opens new window))
Returns
Signature
public Craft\UserGroupModel, null getGroupByHandle ( $groupHandle )
# getGroupById()
Gets a user group by its ID.
View source (opens new window)
Arguments
$groupId
(integer (opens new window))
Returns
Signature
public Craft\UserGroupModel, null getGroupById ( $groupId )