Contao Utils Bundle

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

Methods

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|null

getActiveGroups()

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|null

hasActiveGroup()

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
Return values
bool

        
On this page

Search results