UserUtil
in package
Table of Contents
Constants
- TYPE_MEMBER = 'member'
- TYPE_USER = 'user'
Properties
- $contaoFramework : ContaoFramework
- $databaseUtil : DatabaseUtil
- $modelUtil : ModelUtil
Methods
- __construct() : mixed
- UserUtil constructor.
- findActiveUsersByGroup() : Collection|null
- getActiveGroups() : Collection|null
- Returns all active users userGroups as a Collection of Models or null if user do not belong to any active userGroups
- hasActiveGroup() : bool
- Returns true if the user or member (frontend user) is member of given group, false otherwise.
Constants
TYPE_MEMBER
public
mixed
TYPE_MEMBER
= 'member'
TYPE_USER
public
mixed
TYPE_USER
= 'user'
Properties
$contaoFramework read-only
private
ContaoFramework
$contaoFramework
$databaseUtil read-only
private
DatabaseUtil
$databaseUtil
$modelUtil read-only
private
ModelUtil
$modelUtil
Methods
__construct()
UserUtil constructor.
public
__construct(ModelUtil $modelUtil, DatabaseUtil $databaseUtil, ContaoFramework $contaoFramework) : mixed
Parameters
- $modelUtil : ModelUtil
- $databaseUtil : DatabaseUtil
- $contaoFramework : ContaoFramework
findActiveUsersByGroup()
public
findActiveUsersByGroup(array<string|int, mixed> $groups[, UserType $type = UserType::USER ][, array<string|int, mixed> $options = [] ]) : Collection|null
Parameters
- $groups : array<string|int, mixed>
- $type : UserType = UserType::USER
- $options : array<string|int, mixed> = []
Return values
Collection|nullgetActiveGroups()
Returns all active users userGroups as a Collection of Models or null if user do not belong to any active userGroups
public
getActiveGroups(UserModel|MemberModel $user) : Collection|null
Parameters
- $user : UserModel|MemberModel
Return values
Collection|nullhasActiveGroup()
Returns true if the user or member (frontend user) is member of given group, false otherwise.
public
hasActiveGroup(UserModel|MemberModel $user, int $groupId) : bool
Parameters
- $user : UserModel|MemberModel
- $groupId : int