Copied!

UserServiceDecorator

UserServiceDecorator.php : 28
Implements UserService

Properties

protected $innerService

UserServiceDecorator.php : 31
protected UserService $innerService

Methods

public__construct()

UserServiceDecorator.php : 33
public __construct(UserService $innerService)

Parameters

Name Type Default value Description
$innerService UserService - -

publicassignUserToUserGroup()

UserServiceDecorator.php : 168

Assigns a new user group to the user.

public assignUserToUserGroup(User $user, UserGroup $userGroup) : void

If the user is already in the given user group this method does nothing.

Parameters

Name Type Default value Description
$user User - -
$userGroup UserGroup - -

publiccheckUserCredentials()

UserServiceDecorator.php : 101

Checks if credentials are valid for provided User.

public checkUserCredentials(User $user, string $credentials) : bool

Parameters

Name Type Default value Description
$user User - -
$credentials string - -

Return values

bool

publiccreateUser()

UserServiceDecorator.php : 87

Create a new user. The created user is published by this method.

public createUser(UserCreateStruct $userCreateStruct, array<string|int, mixed> $parentGroups) : User

Parameters

Name Type Default value Description
$userCreateStruct UserCreateStruct -

the data used for creating the user

$parentGroups array<string|int, mixed> -

the groups of type UserGroup which are assigned to the user after creation

Return values

User

publiccreateUserGroup()

UserServiceDecorator.php : 38

Creates a new user group using the data provided in the ContentCreateStruct parameter.

public createUserGroup(UserGroupCreateStruct $userGroupCreateStruct, UserGroup $parentGroup) : UserGroup

In 4.x in the content type parameter in the profile is ignored

  • the content type is determined via configuration and can be set to null. The returned version is published.

Parameters

Name Type Default value Description
$userGroupCreateStruct UserGroupCreateStruct -

a structure for setting all necessary data to create this user group

$parentGroup UserGroup - -

Return values

UserGroup

publicdeleteUser()

UserServiceDecorator.php : 137

This method deletes a user.

public deleteUser(User $user) : array<string|int, int>

Parameters

Name Type Default value Description
$user User - -

Return values

array<string|int, int>

Affected Location Id's (List of Locations of the Content that was deleted)

publicdeleteUserGroup()

UserServiceDecorator.php : 68

Removes a user group.

public deleteUserGroup(UserGroup $userGroup) : array<string|int, int>

the users which are not assigned to other groups will be deleted.

Parameters

Name Type Default value Description
$userGroup UserGroup - -

Return values

array<string|int, int>

Affected Location Id's (List of Locations of the Content that was deleted)

publicexpireUserToken()

UserServiceDecorator.php : 163

Expires user token with user hash.

public expireUserToken(string $hash) : void

Parameters

Name Type Default value Description
$hash string - -

publicgetPasswordInfo()

UserServiceDecorator.php : 244

Returns information about password for a given user.

public getPasswordInfo(User $user) : PasswordInfo

Parameters

Name Type Default value Description
$user User - -

Return values

PasswordInfo

publicisUser()

UserServiceDecorator.php : 200

Checks if Content is a user.

public isUser(Content $content) : bool

@since 7.4

Parameters

Name Type Default value Description
$content Content - -

Return values

bool

publicisUserGroup()

UserServiceDecorator.php : 205

Checks if Content is a user group.

public isUserGroup(Content $content) : bool

Parameters

Name Type Default value Description
$content Content - -

Return values

bool

publicloadSubUserGroups()

UserServiceDecorator.php : 59

Loads the sub groups of a user group.

public loadSubUserGroups(UserGroup $userGroup[, int $offset = 0 ][, int $limit = 25 ][, array<string|int, mixed> $prioritizedLanguages = [] ]) : array<string|int, UserGroup>

Parameters

Name Type Default value Description
$userGroup UserGroup - -
$offset int 0

the start offset for paging

$limit int 25

the number of user groups returned

$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, UserGroup>

publicloadUser()

UserServiceDecorator.php : 94

Loads a user.

public loadUser(int $userId[, array<string|int, mixed> $prioritizedLanguages = [] ]) : User

Parameters

Name Type Default value Description
$userId int - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

User

publicloadUserByEmail()

UserServiceDecorator.php : 116

Loads a user for the given email.

public loadUserByEmail(string $email[, array<string|int, mixed> $prioritizedLanguages = [] ]) : User

Parameters

Name Type Default value Description
$email string - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

User

publicloadUserByLogin()

UserServiceDecorator.php : 109

Loads a user for the given login.

public loadUserByLogin(string $login[, array<string|int, mixed> $prioritizedLanguages = [] ]) : User

Since 6.1 login is case-insensitive across all storage engines and database backends, like was the case with mysql before in Ibexa 3.x/4.x/5.x.

Parameters

Name Type Default value Description
$login string - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

User

publicloadUserByToken()

UserServiceDecorator.php : 130

Loads a user with user hash key.

public loadUserByToken(string $hash[, array<string|int, mixed> $prioritizedLanguages = [] ]) : User

Parameters

Name Type Default value Description
$hash string - -
$prioritizedLanguages array<string|int, mixed> [] -

Return values

User

publicloadUserGroup()

UserServiceDecorator.php : 45

Loads a user group for the given id.

public loadUserGroup(int $id[, array<string|int, mixed> $prioritizedLanguages = [] ]) : UserGroup

Parameters

Name Type Default value Description
$id int - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

UserGroup

publicloadUserGroupByRemoteId()

UserServiceDecorator.php : 52

Loads a user group for the given remote id.

public loadUserGroupByRemoteId(string $remoteId[, array<string|int, mixed> $prioritizedLanguages = [] ]) : UserGroup

Parameters

Name Type Default value Description
$remoteId string - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

UserGroup

publicloadUserGroupsOfUser()

UserServiceDecorator.php : 182

Loads the user groups the user belongs to.

public loadUserGroupsOfUser(User $user[, int $offset = 0 ][, int $limit = 25 ][, array<string|int, mixed> $prioritizedLanguages = [] ]) : array<string|int, UserGroup>

Parameters

Name Type Default value Description
$user User - -
$offset int 0

the start offset for paging

$limit int 25

the number of user groups returned

$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, UserGroup>

publicloadUsersByEmail()

UserServiceDecorator.php : 123

Loads a users for the given email.

public loadUsersByEmail(string $email[, array<string|int, mixed> $prioritizedLanguages = [] ]) : array<string|int, User>

Note: This method loads user by $email where $email might be case-insensitive on certain storage engines!

Returns an array of Users since Ibexa has under certain circumstances allowed several users having same email in the past (by means of a configuration option).

Parameters

Name Type Default value Description
$email string - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, User>

publicloadUsersOfUserGroup()

UserServiceDecorator.php : 191

Loads the users of a user group.

public loadUsersOfUserGroup(UserGroup $userGroup[, int $offset = 0 ][, int $limit = 25 ][, array<string|int, mixed> $prioritizedLanguages = [] ]) : array<string|int, User>

Parameters

Name Type Default value Description
$userGroup UserGroup - -
$offset int 0

the start offset for paging

$limit int 25

the number of users returned

$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, User>

publicmoveUserGroup()

UserServiceDecorator.php : 73

Moves the user group to another parent.

public moveUserGroup(UserGroup $userGroup, UserGroup $newParent) : void

Parameters

Name Type Default value Description
$userGroup UserGroup - -
$newParent UserGroup - -

publicnewUserCreateStruct()

UserServiceDecorator.php : 210

Instantiate a user create class.

public newUserCreateStruct(string $login, string $email, string $password, string $mainLanguageCode[, ContentType|null $contentType = null ]) : UserCreateStruct

Parameters

Name Type Default value Description
$login string -

the login of the new user

$email string -

the email of the new user

$password string -

the plain password of the new user

$mainLanguageCode string -

the main language for the underlying content object

$contentType ContentType|null null

content type for the underlying content object.

Return values

UserCreateStruct

publicnewUserGroupCreateStruct()

UserServiceDecorator.php : 220

Instantiate a user group create class.

public newUserGroupCreateStruct(string $mainLanguageCode[, ContentType|null $contentType = null ]) : UserGroupCreateStruct

Parameters

Name Type Default value Description
$mainLanguageCode string -

The main language for the underlying content object

$contentType ContentType|null null

5.x the content type for the underlying content object. In 4.x it is ignored and taken from the configuration

Return values

UserGroupCreateStruct

publicnewUserGroupUpdateStruct()

UserServiceDecorator.php : 232

Instantiate a new user group update struct.

public newUserGroupUpdateStruct() : UserGroupUpdateStruct

Return values

UserGroupUpdateStruct

publicnewUserUpdateStruct()

UserServiceDecorator.php : 227

Instantiate a new user update struct.

public newUserUpdateStruct() : UserUpdateStruct

Return values

UserUpdateStruct

publicunAssignUserFromUserGroup()

UserServiceDecorator.php : 175

Removes a user group from the user.

public unAssignUserFromUserGroup(User $user, UserGroup $userGroup) : void

Parameters

Name Type Default value Description
$user User - -
$userGroup UserGroup - -

publicupdateUser()

UserServiceDecorator.php : 142

Updates a user.

public updateUser(User $user, UserUpdateStruct $userUpdateStruct) : User

4.x: If the versionUpdateStruct is set in the user update structure, this method internally creates a content draft, updates ts with the provided data and publishes the draft. If a draft is explicitly required, the user group can be updated via the content service methods.

Parameters

Name Type Default value Description
$user User - -
$userUpdateStruct UserUpdateStruct - -

Return values

User

publicupdateUserGroup()

UserServiceDecorator.php : 80

Updates the group profile with fields and meta data.

public updateUserGroup(UserGroup $userGroup, UserGroupUpdateStruct $userGroupUpdateStruct) : UserGroup

4.x: If the versionUpdateStruct is set in $userGroupUpdateStruct, this method internally creates a content draft, updates ts with the provided data and publishes the draft. If a draft is explicitly required, the user group can be updated via the content service methods.

Parameters

Name Type Default value Description
$userGroup UserGroup - -
$userGroupUpdateStruct UserGroupUpdateStruct - -

Return values

UserGroup

publicupdateUserPassword()

UserServiceDecorator.php : 149

Validates and updates just the user's password.

public updateUserPassword(User $user, string $newPassword) : User

Parameters

Name Type Default value Description
$user User - -
$newPassword string - -

Return values

User

publicupdateUserToken()

UserServiceDecorator.php : 156

Update the user token information specified by the user token struct.

public updateUserToken(User $user, UserTokenUpdateStruct $userTokenUpdateStruct) : User

Parameters

Name Type Default value Description
$user User - -
$userTokenUpdateStruct UserTokenUpdateStruct - -

Return values

User

publicvalidatePassword()

UserServiceDecorator.php : 237

Validates given password.

public validatePassword(string $password[, PasswordValidationContext $context = null ]) : array<string|int, ValidationError>

Parameters

Name Type Default value Description
$password string - -
$context PasswordValidationContext null -

Return values

array<string|int, ValidationError>