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.

ORM
getModel()

Returns a model instance.

setIdentifier(string $identifier)

Sets the user identifier.

User|bool
setAuthorizer(User|bool $user)

Sets the authorizer.

createUser(array $properties = [])

No description

User|bool
getByActionToken(string $token)

Fetches a user by its action token.

User|bool
getByAccessToken(string $token)

Fetches a user by its access token.

User|bool
getByEmail(string $email)

Fetches a user by its email address.

User|bool
getByUsername(string $username)

Fetches a user by its username.

User|bool
getById(int $id)

Fetches a user by its id.

User|bool
getByIdentifier($identifier)

No description

Details

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

Constructor.

Parameters

string $model Model name
AuthorizerInterface|null $authorizer Authorizer

at line 66
protected ORM getModel()

Returns a model instance.

Return Value

ORM

at line 79
setIdentifier(string $identifier)

Sets the user identifier.

Parameters

string $identifier User identifier

Exceptions

InvalidArgumentException

at line 95
protected User|bool setAuthorizer(User|bool $user)

Sets the authorizer.

Parameters

User|bool $user User

Return Value

User|bool

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

Parameters

array $properties

Return Value

User

at line 132
User|bool getByActionToken(string $token)

Fetches a user by its action token.

Parameters

string $token Action token

Return Value

User|bool

at line 143
User|bool getByAccessToken(string $token)

Fetches a user by its access token.

Parameters

string $token Access token

Return Value

User|bool

at line 154
User|bool getByEmail(string $email)

Fetches a user by its email address.

Parameters

string $email Email address

Return Value

User|bool

at line 165
User|bool getByUsername(string $username)

Fetches a user by its username.

Parameters

string $username Username

Return Value

User|bool

at line 176
User|bool getById(int $id)

Fetches a user by its id.

Parameters

int $id User id

Return Value

User|bool

at line 25
User|bool getByIdentifier($identifier)

Parameters

$identifier

Return Value

User|bool