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.

User|bool
activateUser(string $token)

Activates a user based on the provided auth token.

Details

at line 50
setUserRepository(UserRepositoryInterface $userRepository)

Sets the user repository.

Parameters

UserRepositoryInterface $userRepository User repository

at line 24
UserRepository getUserRepository()

Return Value

UserRepository

at line 66
setGroupRepository(GroupRepositoryInterface $groupRepository)

Sets the group repository.

Parameters

GroupRepositoryInterface $groupRepository Group repository

at line 24
GroupRepository getGroupRepository()

Return Value

GroupRepository

at line 82
setUser(UserEntityInterface $user)

Sets the active user.

Parameters

UserEntityInterface $user User entity

at line 90
bool isGuest()

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

Return Value

bool

at line 98
bool isLoggedIn()

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

Return Value

bool

at line 113
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 133
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 149
User|bool activateUser(string $token)

Activates a user based on the provided auth token.

Parameters

string $token Auth token

Return Value

User|bool