abstract class Adapter implements AdapterInterface, WithGroupsInterface

Base adapter.

Properties

protected UserRepository $userRepository User repository.
protected GroupRepository $groupRepository Group repository.
protected User|null $user User entity.

Methods

setUserRepository(UserRepositoryInterface $userRepository)

Sets the user repository.

setGroupRepository(GroupRepositoryInterface $groupRepository)

Sets the group repository.

setUser(UserEntityInterface $user)

Sets the active user.

bool
isGuest()

Returns TRUE if we don't have an authenticated user and FALSE if we do.

bool
isLoggedIn()

Returns TRUE if we have an authenticated user and FALSE if we don't.

createUser(string $email, string $username, string $password, bool $activate = false, array $properties = [])

Creates a new user and returns the user object.

createGroup(string $name, array $properties = [])

Creates a new group and returns the group object.

bool
activateUser(string $token)

Activates a user based on the provided action token.

Details

at line 48
setUserRepository(UserRepositoryInterface $userRepository)

Sets the user repository.

Parameters

UserRepositoryInterface $userRepository User repository

at line 22
UserRepository getUserRepository()

Return Value

UserRepository

at line 64
setGroupRepository(GroupRepositoryInterface $groupRepository)

Sets the group repository.

Parameters

GroupRepositoryInterface $groupRepository Group repository

at line 22
GroupRepository getGroupRepository()

Return Value

GroupRepository

at line 80
setUser(UserEntityInterface $user)

Sets the active user.

Parameters

UserEntityInterface $user User entity

at line 88
bool isGuest()

Returns TRUE if we don't have an authenticated user and FALSE if we do.

Return Value

bool

at line 96
bool isLoggedIn()

Returns TRUE if we have an authenticated user and FALSE if we don't.

Return Value

bool

at line 111
User createUser(string $email, string $username, string $password, bool $activate = false, array $properties = [])

Creates a new user and returns the user object.

Parameters

string $email Email address
string $username Username
string $password Password
bool $activate Will activate the user if set to true
array $properties Additional user properties

Return Value

User

at line 131
Group createGroup(string $name, array $properties = [])

Creates a new group and returns the group object.

Parameters

string $name Group name
array $properties Additional group properties

Return Value

Group

at line 147
bool activateUser(string $token)

Activates a user based on the provided action token.

Parameters

string $token Action token

Return Value

bool