class UserRepository implements UserRepositoryInterface

User repository.

Properties

protected string $model Model name.
protected AuthorizerInterface|null $authorizer Authorizer.
protected string $identifier User identifier.

Methods

__construct(string $model, AuthorizerInterface|null $authorizer = null)

Constructor.

getModel()

Returns a model instance.

setIdentifier(string $identifier)

Sets the user identifier.

User|null
setAuthorizer(User|null $user)

Sets the authorizer.

createUser(array $properties = [])

No description

User|null
getByActionToken(string $token)

Fetches a user by its action token.

User|null
getByAccessToken(string $token)

Fetches a user by its access token.

User|null
getByEmail(string $email)

Fetches a user by its email address.

User|null
getByUsername(string $username)

Fetches a user by its username.

User|null
getById(int $id)

Fetches a user by its id.

User|null
getByIdentifier($identifier)

No description

Details

at line 52
__construct(string $model, AuthorizerInterface|null $authorizer = null)

Constructor.

Parameters

string $model Model name
AuthorizerInterface|null $authorizer Authorizer

at line 64
protected User getModel()

Returns a model instance.

Return Value

User

at line 76
setIdentifier(string $identifier)

Sets the user identifier.

Parameters

string $identifier User identifier

at line 92
protected User|null setAuthorizer(User|null $user)

Sets the authorizer.

Parameters

User|null $user User

Return Value

User|null

at line 23
User createUser(array $properties = [])

Parameters

array $properties

Return Value

User

at line 129
User|null getByActionToken(string $token)

Fetches a user by its action token.

Parameters

string $token Action token

Return Value

User|null

at line 140
User|null getByAccessToken(string $token)

Fetches a user by its access token.

Parameters

string $token Access token

Return Value

User|null

at line 151
User|null getByEmail(string $email)

Fetches a user by its email address.

Parameters

string $email Email address

Return Value

User|null

at line 162
User|null getByUsername(string $username)

Fetches a user by its username.

Parameters

string $username Username

Return Value

User|null

at line 173
User|null getById(int $id)

Fetches a user by its id.

Parameters

int $id User id

Return Value

User|null

at line 23
User|null getByIdentifier($identifier)

Parameters

$identifier

Return Value

User|null